Commit graph

4 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
66794c9bc9 tests: y4mreader: fix string state checkup
str cannot be null in that moment, but it may be the end of string.
2018-01-10 17:06:53 +01:00
Víctor Manuel Jáquez Leal
3ee955a2f2 tests: y4mreader: use int for fgetc
Assigning the return value of fgetc to char truncates its value.

It will not be possible to distinguish between EOF and a valid
character.
2018-01-10 16:59:56 +01:00
Víctor Manuel Jáquez Leal
2b9712ca2d tests: y4mreader: fix incompatible cast
Passed pointer in parse_int() are unsigned int (32 bits, unsigned) but
they are dereferenced as a wider long (64 bits, signed). This may lead
to memory corruption.
2018-01-10 16:48:07 +01:00
Víctor Manuel Jáquez Leal
be40a1d479 tests: add simple-encoder program
This patch adds a simple-encoder test program that uses libgstvaapi for video
encoding to elementary (raw) streams. Input stream is raw YUV in the Y4M
format. That can be from a regular file or standard input when the input
filename is "-".

Usage: simple-encoder [options]* <source>

Options:
--output|-o     output file name
--codec|-c      codec to use for video encoding
--bitrate|-b    desired bitrate (kbps)

By default, and as an initial patch, the encoded stream shall conform to the
minimally supported profile. That is "Constrained Baseline Profile" for H.264
and "Simple Profile" for MPEG-2. Though, those are the defaults to be
generated by libgstvaapi.

You can find Y4M sample files here http://samples.mplayerhq.hu/yuv4mpeg2/

Original-patch-by: Changzhi Wei <changzhix.wei@intel.com>
* general code clean-up
* removed the yuv reader thread
* re-wrote the y4m file parser
* updated used API fixed some wrong usage
* fixed a lot of memory leaks
* added the bitrate setting
* keep fps' numerator and denominator
* simplified the thread control
* removed custom logging and use glib

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=719528
2015-05-12 11:24:41 +02:00