Commit graph

528 commits

Author SHA1 Message Date
Simon Farnsworth
b07eb2056b vc1: use pixel-aspect-ratio from bitstream parser.
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-10-11 15:00:44 +02:00
Simon Farnsworth
bd11baedc5 mpeg2: use pixel-aspec-ratio information from bitstream parser.
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-10-11 14:58:38 +02:00
Gwenole Beauchesne
022e99e127 codecparsers: h264: use submodule sources.
Use newer sources from the codecparsers/ submodule for
- GstH264SliceHdr.n_emulation_prevention_bytes: EPBs;
- GstH264VUIParams.{par_n,par_d}: pixel-aspect-ratio.
2012-10-11 14:19:39 +02:00
Gwenole Beauchesne
cee782a177 codecparsers: jpeg: use submodule sources. 2012-10-11 14:19:38 +02:00
Simon Farnsworth
fa87396905 h264: use pixel-aspect-ratio from SPS header.
Propagate pixel-aspect-ratio determined by the GStreamer codecparser
from the sequence headers.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-10-10 11:29:00 +02:00
Gwenole Beauchesne
3f430b32a4 h264: add decode_nalu() helper function.
Split decode_buffer() into the core infrastructure that determines
the NAL units contained in the adapter and the actual function that
decodes the NAL unit.
2012-10-10 10:35:20 +02:00
Gwenole Beauchesne
6f2e885f11 h264: fix end-of-stream conditions (flush).
Decode pending data in the adapter prior to processing the actual
code for end-of-stream.
2012-10-10 10:31:39 +02:00
Gwenole Beauchesne
388e881ba9 mpeg2: add decode_packet() helper function.
Split decode_buffer() into the core infrastructure that determines
the packets contained in the adapter and the actual function that
decodes the packet data.
2012-10-10 09:45:03 +02:00
Gwenole Beauchesne
dc03ca9100 mpeg2: fix end-of-stream conditions (flush).
Decode pending data in the adapter prior to processing the actual
code for end-of-stream. Initial code from Feng Yuan.
2012-10-09 18:08:50 +02:00
Gwenole Beauchesne
91da4fcb18 mpeg2: fix memory leak of empty packets.
Fix memory leakage of empty packets, i.e. packets that only contain
the start code prefix. In particular, free empty user-data packets.

Besides, the codec parser will already fail gracefully if the packet
to parse does not have the minimum required size. So, we can also
completely drop the block of code that used to handle packets of size 4
(including the start code).
2012-10-09 18:05:48 +02:00
Gwenole Beauchesne
8f7d19f010 mpeg2: fix return value for "no-data" conditions.
Fix return value when the second scan for start code fails. This means
there is not enough data to determine the full extents of the current
packet and the function shall return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA
in this case, instead of GST_VAAPI_DECODER_STATUS_SUCCESS.
2012-10-09 18:05:47 +02:00
Gwenole Beauchesne
86981eea41 decoder: refine semantics of gst_vaapi_decoder_put_buffer().
Improve the semantics for gst_vaapi_decoder_put_buffer() when an empty
buffer is passed on. An empty buffer is a buffer with a NULL data pointer
or with a size equals to zero. In this case, that buffer is simply
skipped and the function returns TRUE. A NULL buffer argument still
marks the end-of-stream.
2012-10-09 15:04:36 +02:00
Gwenole Beauchesne
d7fccc351a decoder: drop unused functions. 2012-10-09 14:40:00 +02:00
Gwenole Beauchesne
86b70977f8 wayland: cosmetics (remove tabs). 2012-10-05 13:38:48 +02:00
Rob Bradford
0cde1f5289 wayland: add support for windowed mode.
Rather than always making the surface fullscreen instead implement the
set_fullscreen vfunc on GstVaapiWindow and then set the shell surface
fullscreen on not depending on that.

Reviewed-by: Joe Konno <joe.konno@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-10-05 13:38:46 +02:00
Gwenole Beauchesne
a6a1ea09a3 utils: drop unused GLX helpers.
Remove helpers for GL_ARB_fragment_program and GL_ARB_multitexture
extensions since they are not used throughout gstreamer-vaapi.
2012-09-27 11:08:58 +02:00
Gwenole Beauchesne
5db2e93d3c utils: fix build with <GL/glext.h> version >= 85.
Mesa recently updated the <GL/glext.h> header version to Khronos version 85.
This caused the PFNGLMULTITEXCOORD2FPROC definition to be moved out of the
GL_VERSION_1_3_DEPRECATED block. However, since <GL/gl.h> also defines
GL_VERSION_1_3 to 1, the definitions in <GL/glext.h> are then not enabled,
thus leaving PFNGLMULTITEXCOORD2FPROC undefined as well.

Provide a PFNGLMULTITEXCOORD2FPROC replacement as an interim solution for
newer versions of the <GL/glext.h> header.
2012-09-27 11:04:24 +02:00
Gwenole Beauchesne
1c5c5ea9b8 h264: review and report errors accordingly.
Use GST_ERROR() to report real errors instead of hiding them into
GST_DEBUG().
2012-09-21 16:43:38 +02:00
Gwenole Beauchesne
dde9232e10 h264: exclusively use GstAdapter, drop sub-buffer hack.
Maintaining the sub-buffer is rather suboptimal especially since we
were also maintaining a GstAdapter. Now, we only use the GstAdapter
thus requiring minor extra parsing when receiving avcC buffers.
2012-09-20 18:04:19 +02:00
Kristian Høgsberg
38ed8008b1 wayland: set opaque region for YUV surface.
This allows the compositor to optimize redraws and cull away changes
obscured by the video surface.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-09-17 10:06:13 +02:00
Gwenole Beauchesne
f65a413500 glibcompat: add replacement for g_cond_wait_until(). 2012-09-12 13:42:49 +02:00
Gwenole Beauchesne
c4ccc0a74b codecparsers: jpeg: add missing includes. 2012-09-12 10:40:06 +02:00
Gwenole Beauchesne
5549dbc3c0 vaapidecode: don't reset decoder if codec type is the same.
Reset, i.e. destroy then create, the decoder in _setcaps() handler only
if the underlying codec type actually changed. This makes it possible
to be more tolerant with certain MPEG-2 streams that get parsed to
form caps that are compatible with the previous state but minor changes
to "codec-data".
2012-09-11 17:08:47 +02:00
Gwenole Beauchesne
6c19849cd2 decoder: propagate buffer duration downstream. 2012-09-11 17:08:47 +02:00
Gwenole Beauchesne
e4d27fba6b surfaceproxy: add "duration" property. 2012-09-11 17:08:47 +02:00
Gwenole Beauchesne
a10b3d3032 decoder: cope with new GstVaapiContextInfo based API.
Update decoders to report the maximum number of reference frames to use.
2012-09-10 18:27:40 +02:00
Gwenole Beauchesne
893e45ecb5 context: JPEG codec does not need any reference frame. 2012-09-10 18:17:10 +02:00
Gwenole Beauchesne
4ca1f3f47c context: allow number of reference frames to be set.
Make it possible to specify the maximum number of references to use within
a single VA context. This helps reducing GPU memory allocations to the useful
number of references to be used.
2012-09-10 18:15:02 +02:00
Gwenole Beauchesne
cf75d048a1 mpeg4: fix debug info for unsupported profile. 2012-09-07 16:23:43 +02:00
Gwenole Beauchesne
61cc02f54b libs: fix build in strict ISO C mode. 2012-09-07 16:23:42 +02:00
Gwenole Beauchesne
cdc6329182 decoder: drop extraneous return for void function. 2012-09-07 11:58:53 +02:00
Gwenole Beauchesne
c6d64527b5 image: don't use (void *) pointer arithmetic. 2012-09-07 11:58:35 +02:00
Philip Lorenz
79b45a43d1 Do not forward declare enums.
Forward declaring enums is not allowed by the C standard and aborts
compilation if the header file is included in a C++ project.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-09-07 11:54:09 +02:00
Gwenole Beauchesne
09724e12de display: fix display aspect ratio when display is rotated. 2012-09-06 13:39:50 +02:00
Gwenole Beauchesne
30a8c566b7 display: fix physical display size when display is rotated. 2012-09-06 13:39:50 +02:00
Gwenole Beauchesne
2a7cefab1a display: fix GstVaapiRotation enumeration of values. 2012-08-30 16:30:14 +02:00
Gwenole Beauchesne
4a1127dd7c vaapisink: drop obsolete GstVaapiVideoSink interface.
This interface was deprecated since 0.3.x series when the GstVideoContext
interface was added to the main GStreamer APIs.
2012-08-29 13:20:17 +02:00
Gwenole Beauchesne
9b11f069c9 display: partially revert 8ebe4d6.
Don't try to fix up the initial values, this could make things worse.
Simply assume the driver does not support the capability in this case.
2012-08-29 10:13:58 +02:00
Gwenole Beauchesne
8ebe4d63d5 display: fix validation process of properties during discovery.
Some VA drivers (e.g. EMGD) can have completely random values for initial
display attributes. So, try to improve the discovery process to check the
initial display attribute values actually fall within valid bounds. If not,
try to reset those to some sensible values like the default value reported
through vaQueryDisplayAttributes().
2012-08-28 17:42:19 +02:00
Gwenole Beauchesne
fafcf0e13c display: add color balance properties.
Add support for hue, saturation, brightness and contrast attributes.
2012-08-28 17:42:13 +02:00
Gwenole Beauchesne
4dad571526 display: initialize default attribute values.
Ensure the display attribute is actually supported by trying to retrieve
its current value during GstVaapiDisplay creation.
2012-08-28 16:31:58 +02:00
Gwenole Beauchesne
112e2b1fe7 display: raise "notify" for property changes. 2012-08-28 16:31:56 +02:00
Gwenole Beauchesne
9c714cf7a0 display: expose display attributes as GObject properties.
Expose VA display "render-mode" and "rotation" attributes as standard
GObject properties.
2012-08-28 16:28:49 +02:00
Gwenole Beauchesne
fe4ad408dc display: install properties in batch.
Use g_object_class_install_properties() to install GstVaapiDisplay properties.
It is useful to maintain properties as GParamSpec so that to be able to raise
"notify" signals by id instead of by name in the future.
2012-08-28 16:24:15 +02:00
Gwenole Beauchesne
1069ce433f display: fix gst_vaapi_display_has_property().
Append the "render-mode" and "rotation" properties, should they be supported
by the underlying VA driver.
2012-08-27 19:00:37 +02:00
Wind Yuan
c899947e17 display: add support for rotation modes.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-08-27 18:41:22 +02:00
Gwenole Beauchesne
a192f40ed9 display: add support for rendering modes.
A rendering mode can be "overlay" or "texture"'ed blit.

The former mode implies that a VA surface used for rendering can't be
re-used right away for decoding, so the sink shall make provisions to
retain the associated surface proxy until the next surface is to be
displayed.

The latter mode implies that the VA surface is implicitly copied to an
intermediate backing store, or back buffer of a frame buffer, so the
associated surface proxy can be disposed right away.
2012-08-27 17:52:32 +02:00
Gwenole Beauchesne
a503aaf9b9 display: add initial support for display attributes.
The VA display attributes are mapped to properties so that to maintain the
GStreamer terminology. Properties are to be identified by name, but internal
functions are available to lookup the property by the actual VA display
attribute type.
2012-08-27 17:52:32 +02:00
Sreerenj Balachandran
f2741a88cc jpeg: fix end-of-image (EOI) handler.
decode_current_picture() was converted to return a gboolean instead
of a GstVaapiDecoderStatus, so we were not getting out of the decode
loop as expected, or could cause an error instead.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-08-27 11:03:16 +02:00
Gwenole Beauchesne
1fb8f4791f mpeg2: include start code into VA slice data buffer.
Integrate the start code prefix in the slice data buffer that is submitted
to the hardware. VA-API specifies that slice_data_offset is the offset to
the first byte of slice data. And, for MPEG-2, slice() data begins with
the slice_start_code. Some VA driver implementations (EMGD) expect this.
2012-08-27 10:36:51 +02:00