Commit graph

554 commits

Author SHA1 Message Date
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
Javier Jardón
5157a01942 decoder: use g_object_notify_by_pspec().
Use g_object_notify_by_pspec() instead of g_object_notify() so that to
avoid a property name lookup. i.e. this makes notifications faster to
the `vaapidecode' element.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-08-27 09:56:47 +02:00
Gwenole Beauchesne
a10ee527c7 wayland: handle de-interlacing flags.
VA/Wayland API was updated to allow flags for bob deinterlacing.
More elaborated filters will require a complete VA/VPP pipeline.
2012-08-06 19:21:03 +02:00
Gwenole Beauchesne
0b3d75f14b jpeg: fix default quantization tables.
Two elements in the luminance quantization table were wrong. So,
gst_jpeg_get_default_quantization_tables() now reconstructs tables
in zig-zag order from the standard ones (Tables K.1 and K.2).
2012-08-02 18:27:48 +02:00
Gwenole Beauchesne
f88323857d jpeg: compute default Huffman tables.
... instead of having them pre-calculated. This saves around 1.5 KB
of data in the DSO but requires gst_jpeg_get_default_huffman_tables()
to do more work. Though, the client application may have to call that
function at most once, only.
2012-08-02 15:17:57 +02:00
Gwenole Beauchesne
71e4936e5e display: drop VAProfileNone entries from debug messages. 2012-08-01 18:30:27 +02:00
Yan Yin
8bd3070c51 display: query for supported display attributes.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-08-01 18:27:38 +02:00
Yan Yin
a72d10ca0e utils: add string_of_VADisplayAttributeType() helper.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-08-01 18:27:37 +02:00
Gwenole Beauchesne
657f0a4a6f Add initial support for VA/DRM. 2012-08-01 16:40:17 +02:00
Gwenole Beauchesne
7070961202 Fix build without X11 (again).
Don't try to build libgstvaapi-x11.so.* if X11 was disabled. Also shuffle
files list wrt. x11, glx and wayland backends.
2012-07-31 17:58:43 +02:00
Gwenole Beauchesne
7c1b9b48e4 jpeg: update to the latest VA-API changes (0.32.1+). 2012-07-31 11:51:57 +02:00
Gwenole Beauchesne
4401ada22a wayland: implement display ::get_size*() hooks. 2012-07-27 14:35:48 +02:00
Kristian Høgsberg
22b2c2cb4f wayland: use scale fullscreen method.
This makes the compositor scale the surface to fit and preserves aspect
ratio.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-26 16:12:56 +02:00
Kristian Høgsberg
44d6f7631b wayland: respond to ping/pong protocol so we're not deemed unresponsive.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-26 16:12:56 +02:00
Gwenole Beauchesne
af3b6dc2b8 wayland: fix double disconnect of display. 2012-07-25 15:31:42 +02:00
Gwenole Beauchesne
5be6de20cb wayland: mangle display name for cache lookups. 2012-07-25 15:31:42 +02:00
Gwenole Beauchesne
0bf1e761f9 Fix build without X11. 2012-07-25 15:31:42 +02:00
Gwenole Beauchesne
9e00c87367 plugins: add support for Wayland. 2012-07-25 15:31:42 +02:00
Sreerenj Balachandran
621bb12be6 Add initial support for VA/Wayland.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-25 15:31:42 +02:00
Gwenole Beauchesne
4e53b5fe4e display: fix destruction of mutex. 2012-07-25 14:37:11 +02:00
Gwenole Beauchesne
437bc925f6 display: add display types.
Move display types from gstvaapipluginutil.* to gstvaapidisplay.* so that
we could simplify characterization of a GstVaapiDisplay. Also rename "auto"
type to "any", and add a "display-type" attribute.
2012-07-25 14:37:11 +02:00
Gwenole Beauchesne
411b970f8a display: use prefixed display names for cache lookups.
This improves display name comparisons by always allocating a valid display
name. This also helps to disambiguate lookups by name in the global display
cache, should a new backend be implemented.
2012-07-25 14:27:05 +02:00
Gwenole Beauchesne
8ef490a3de videobuffer: drop deprecated functions.
Move video buffer creation routines to plugin elements. That exclusively
uses *_typed_new*() variants.
2012-07-24 16:13:31 +02:00
Gwenole Beauchesne
809a85433d videobuffer: mark video buffer creation routines as deprecated.
The vdeo buffer creation routines shall actually be internal to gstreamer-vaapi
plugin elements. So deprecate any explicit creation routines that are not the
new *_typed_new*() variants.
2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
e12ef8e6a2 videobuffer: factor out base and GLX implementations.
Introduce new typed constructors internal to gstreamer-vaapi plugin elements.
This avoids duplication of code, and makes it possible to further implement
generic video buffer creation routines that automatically map to base or GLX
variants.
2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
e52def4737 utils: fix gl_create_context() with parent context set.
If GLX window was created from a foreign Display, then that same Display shall
be used for subsequent glXMakeCurrent(). This means that gl_create_context()
will now use the same Display that the parent, if available.

This fixes cluttersink with the Intel GenX VA driver.
2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
7a0382130f configure: drop check for --enable-vaapi-glx.
This flag is obsolete. It was meant to explicitly enable/disable VA/GLX API
support, or fallback to TFP+FBO if this API is not found. Now, we check for
the VA/GLX API by default if --enable-glx is set. If this API is not found,
we now default to use TFP+FBO.

Note: TFP+FBO, i.e. using vaPutSurface() is now also a deprecated usage and
will be removed in the future. If GLX rendering is requested, then the VA/GLX
API shall be used as it covers most usages. e.g. AMD driver can't render to
an X pixmap yet.
2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
b6c97e31ee configure: improve checks for GLX. 2012-07-20 14:44:27 +02:00
Gwenole Beauchesne
9491a35731 Drop support for obsolete VA-API versions < 0.30.4. 2012-07-20 14:11:42 +02:00
Gwenole Beauchesne
bcae632c32 vaapisink: drop checks for new APIs used by default.
GStreamer -base plugins >= 0.10.31 are now required, so the checks for
new APIs like GstXOverlay::set_window_handle() and ::set_render_rectangle()
are no longer necessary.
2012-07-20 14:11:42 +02:00
Gwenole Beauchesne
d8b0c8ec38 Use standard G_GNUC_INTERNAL keyword instead of attribute_hidden. 2012-07-19 18:01:12 +02:00
Gwenole Beauchesne
562d98ec56 Drop obsolete GstVaapiTSB.
It has been replaced with a GstAdapter and gst_adapter_prev_pts().
2012-07-19 17:58:21 +02:00
Gwenole Beauchesne
9d440fafb3 Drop all references to USE_CODEC_PARSERS. 2012-07-19 17:30:36 +02:00
Gwenole Beauchesne
7f47ac3bea Drop FFmpeg-based decoders.
GStreamer codecparsers-based decoders are the only supported decoders now.
Though, FFmpeg decoders are still available in gstreamer-vaapi 0.3.x series.
2012-07-19 17:30:36 +02:00
Javier Jardón
dba174906a libs: declare _get_type() functions as const.
Declaring a function as const enables better optimization of calls
to the function.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 15:19:17 +02:00
Javier Jardón
30024b3f8e libs: use g_clear_object() wherever applicable.
This is a preferred thread-safe version. Also add an inline version of
g_clear_object() if compiling with glib < 2.28.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 15:19:17 +02:00
Javier Jardón
c415868f26 libs: use generic g_cclosure_marshal_VOID__VOID().
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 15:19:16 +02:00
Gwenole Beauchesne
27c8269b43 glibcompat: drop explicit check for g_list_free_full(). 2012-07-19 14:29:33 +02:00
Gwenole Beauchesne
fbb9a5e1c0 jpeg: fix make dist. 2012-07-19 13:57:05 +02:00
Gwenole Beauchesne
1139908487 jpeg: update to match latest parser API. 2012-07-17 18:02:16 +02:00
Gwenole Beauchesne
8f93bbc937 codecparsers: jpeg: tweak parser API.
... to allow for more consistent parsing API among various codec parsers.
In particular, drop use of GList.
2012-07-17 18:02:16 +02:00
Gwenole Beauchesne
06be1afea6 jpeg: fix build with VA-API < 0.32.0. 2012-06-26 15:18:53 +02:00
Gwenole Beauchesne
a9bd8400db Fix build with recent GStreamer stack. 2012-06-26 10:57:34 +02:00
Gwenole Beauchesne
4e1a354340 jpeg: update to current VA/JPEG decoding API. 2012-06-26 10:57:34 +02:00
Gwenole Beauchesne
326a229636 codecparsers: jpeg: track valid quantization and Huffman tables.
Add valid flag to GstJpegQuantTable and GstJpegHuffmanTable so that
to determine whether a table actually changed since the last user
synchronization point. That way, this makes it possible for some
hardware accelerated decoding solution to upload only those tables
that changed.
2012-06-21 16:06:47 +02:00
Wind Yuan
e61f4c4445 codecparsers: jpeg: use U_READ_UINT*() wherever possible.
Use GstByteReader *_unchecked() variants as much as possible.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-06-21 15:30:54 +02:00
Wind Yuan
90e6532fd3 jpeg: add new GstJpegHuffmanTables structure.
Add new GstJpegHuffmanTables helper structure to hold all possible
AC/DC Huffman tables available to all components.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-06-21 15:30:54 +02:00
Wind Yuan
4c5cc7eff9 jpeg: make gst_jpeg_parse() support multiple scans.
gst_jpeg_parse() now gathers all scans available in the supplied
buffer. A scan comprises of the scan header and any entropy-coded
segments or restart marker following it. The size and offset to
the associated data (ECS + RST segments) are append to a new
GstJpegScanOffsetSize structure.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-06-21 15:30:53 +02:00
Wind Yuan
53cbdcc1e6 jpeg: update to match latest parser API.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-05-15 18:25:03 +02:00
Gwenole Beauchesne
0cf06cdbcb jpeg: simplify and optimize parser API. 2012-05-15 16:08:44 +02:00
Wind Yuan
0fe727ba77 mpeg: fix picture used to determine backward_reference_vop_coding_type.
Complete fix brought by bf9f77b1af
but Gwenole did not apply all the bits.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-05-11 11:20:45 +02:00
Wind Yuan
c40c05dc45 mpeg4: map Simple_Scalable profile to Advanced_Simple profile.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-05-10 11:52:06 +02:00
Wind Yuan
96437a7a16 mpeg4: handle skipped frames (vop_hdr->coded = 0).
Gracefully skip non VOP coded frames.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-05-10 11:52:06 +02:00
Wind Yuan
1632b40982 mpeg4: fix timestamp issues on too fast playback.
Improve generation of presentation timestamps to be less sensitive
to input stream errors. In practise, GOP is also a synchronization
point for PTS calculation.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-05-10 11:38:06 +02:00
Gwenole Beauchesne
449606efc5 Fix build without JPEG decoder. 2012-04-16 10:02:29 +02:00
Wind Yuan
bf9f77b1af mpeg4: fix VOP coding type of backward reference pictures.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-04-12 11:48:24 +02:00
Wind Yuan
60b5c2da97 mpeg4: fix handling of temporal reference distances.
TRD and TRB fields are not large enough to hold the difference of PTS
expressed with nanosecond resolution. So, compute them from the original
VOP info.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-04-12 11:44:16 +02:00
Gwenole Beauchesne
687b482895 dpb: mpeg2: cosmetics.
Define MAX_MPEG2_REFERENCES to 2 and avoid magic numbers all around.
2012-04-12 11:00:22 +02:00
Wind Yuan
75e8a7d6f8 Add initial JPEG decoder.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-04-11 19:38:12 +02:00
Wind Yuan
c350a0809d codecparsers: add JPEG parser.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-04-11 19:38:12 +02:00
Gwenole Beauchesne
49b1dca2d3 mpeg2: fix calculation of macroblock_offset.
Fix decoding of streams with extra slice() information before the first
macroblock(). e.g. this fixes sony-ct3.bs from conformance test.
2012-04-02 18:42:12 +02:00
Gwenole Beauchesne
2d36f6199e mpeg2: fix interpolation of GOP TSN from new PTS.
New GOP TSN base could be mis-calculated. In particular, this fixes
decoding of uruseiyatsura.vob from <http://samples.mplayerhq.hu/>.
2012-04-02 18:09:21 +02:00
Gwenole Beauchesne
9c8b85b3c7 mpeg2: fix decoding of high profile streams.
Allow MPEG-2 High profile streams only if the HW supports that profile
or no High profile specific bits are used, and thus Main profile could
be used instead. i.e. chroma_format is 4:2:0, intra_dc_precision is not
set to 11 and no sequence_scalable_extension() was parsed.
2012-04-02 16:12:32 +02:00
Gwenole Beauchesne
d9c57a236d Fix a few documentation issues. 2012-04-02 13:06:15 +02:00
Gwenole Beauchesne
5975def8ab mpeg2: allocate dummy picture for first field based I-frame.
In P-pictures, prediction shall be made from the two most recently
decoded reference fields. However, when the first I-frame is a field,
the next field of the current picture could be a P-picture but only a
single field was decoded so far. In this case, create a dummy picture
with POC = -1 that will be used as reference.

Some VA drivers would error out if P-pictures don't have a forward
reference picture. This is true in general but not in this very specific
initial case.
2012-04-02 11:36:56 +02:00
Gwenole Beauchesne
99932049e4 mpeg2: fix simple to main profile fallback.
Allow fallback from simple to main profile when the HW decoder does
not support the former profile and that no sequence_header_extension()
is available to point out this.
2012-04-02 11:36:56 +02:00
Wind Yuan
b33dd69300 mpeg4: improve error checking while decoding packets.
decode_picture() could return an error when an MPEG-4 profile is not
supported for example. In this case, the underlying VA context is not
allocated and no other proper action can be taken. Likewise on exit
from decode_slice().

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-03-30 17:23:38 +02:00
Gwenole Beauchesne
75538bbc9b decoder: use POC to maintain the DPB.
Introduce a POC field in GstVaapiPicture so that to store simpler sequential
numbers. A signed 32-bit integer should be enough for 1 year of continuous
video streaming at 60 Hz.

Use this new POC value to maintain the DPB, instead of 64-bit timestamps.
This also aligns with H.264 that will be migrated to GstVaapiDpb infrastructure.
2012-03-30 17:08:37 +02:00
Gwenole Beauchesne
d51bb87482 mpeg2: rework generation of presentation timestamps.
Always prefer PTS from the demuxer layer for GOP times. If this is invalid,
i.e. demuxer could not determine the PTS or the generated PTS is lower than
max PTS from past pictures, then try to fix it up based on the duration of
a frame.

For picture PTS, simply use the GOP PTS formerly computed then use TSN to
reconstruct a current time. Also now handle wrapped TSN correctly.
2012-03-30 17:08:37 +02:00
Gwenole Beauchesne
6eeb20a953 mpeg2: ignore empty user-data packets.
Fix tcela-8.bits conformance test.
2012-03-30 17:08:37 +02:00
Gwenole Beauchesne
7af40475d5 mpeg2: review and report errors accordingly.
Use GST_ERROR() to report real errors instead of hiding them into
GST_DEBUG().
2012-03-29 11:13:20 +02:00
Gwenole Beauchesne
b003a2bab2 mpeg2: fix invalid interlaced frame in progressive sequence.
Some streams, badly constructed, could have signaled an interlaced
frame while the sequence was meant to be progressive. Warn and force
frame to be progressive in this case.
2012-03-28 19:41:28 +02:00
Gwenole Beauchesne
7a9410f826 mpeg2: add support for interlaced streams.
Pictures are submitted to the HW for rendering only when both fields
are decoded or current picture is a full frame.
2012-03-28 19:40:27 +02:00
Gwenole Beauchesne
ac4fc0d36c mpeg2: add new decoded picture buffer infrastructure.
Decoded pictures are now maintained into DPB, similarly to H.264.
The same mechanism could be re-used for VC-1 and MPEG-4:2 codecs.
2012-03-28 19:36:52 +02:00
Gwenole Beauchesne
b56ac16224 decoder: add first-field flag to picture.
Add first-field (FF) flag to GstVaapiPicture, thus not requiring is_first_field
member in each decoder. Rather, when a GstVaapiPicture is created, it is considered
as the first field. Any subsequent allocated field will become the second field.
2012-03-28 19:25:49 +02:00