Commit graph

455 commits

Author SHA1 Message Date
Gwenole Beauchesne
a79c7f9fa6 decoder: optimize slice data buffers initialization.
VA drivers may have a faster means to transfer user buffers to GPU
buffers than using memcpy(). In particular, on Intel Gen graphics, we
can use pwrite(). This provides for faster upload of bitstream and can
help higher bitrates.

vaapi_create_buffer() helper function was also updated to allow for
un-mapped buffers and pre-initialized data for buffers.
2012-01-30 10:32:14 +01:00
Gwenole Beauchesne
5cd0242bbb h264: simplify RefPicList reconstruction. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
d656b958a3 h264: flush DPB when the end of the sequence is reached. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
e52ca4a2c8 h264: handle Decoded Picture Buffer (DPB). 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
425060a7a8 h264: fix pred_weight_table() reconstruction.
Only the explicit pred_weight_table(), possibly with the inferred default
values, shall be required. e.g. don't fill in the table if weighted_pred_flag
is not set for P/SP slices.
2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
8c37221fa5 h264: execute reference picture marking process (MMCO). 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
61753fd55a h264: fix presentation timestamps. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
16ccf82363 h264: execute reference picture marking process (sliding window). 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
5a795b439c h264: handle avcC format for decoding buffers. 2012-01-29 15:27:59 +01:00
Sreerenj Balachandran
6d61965531 h264: handle codec-data.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
c071f80f40 Add initial H.264 decoder. 2012-01-29 15:27:59 +01:00
Gwenole Beauchesne
4a46b5d6c4 decoder: retain proxy surface until the GstVaapiPicture is destroyed.
Keep a valid reference to the proxy in GstVaapiPicture so that frames
marked as "used for reference" could be kept during the lifetime of the
picture. i.e. don't release them too soon as they could be re-used right
away.
2012-01-27 15:56:32 +01:00
Gwenole Beauchesne
2897618b85 decoder: properly reference count pictures.
This fixes cases where a GstVaapiPicture would be destroyed whereas
there is still a valid instance of it in either prev, current or
next picture.
2012-01-27 13:28:12 +01:00
Gwenole Beauchesne
7b19745141 decoder: simplify output of decoded frames.
Drop obsolete gst_vaapi_decoder_push_surface() that was no longer used.
Change gst_vaapi_decoder_push_surface_proxy() semantics to assume PTS
is already set correctly and reference count increased, if necessary.
2012-01-27 13:28:12 +01:00
Gwenole Beauchesne
e5d12e8853 decoder: rework the internal VA objects API.
The new API simplifies a lot reference counting and makes it more
flexible for future additions/changes. The GstVaapiCodecInfo is
also gone. Rather, new helper macros are provided to allocate
picture, slice and quantization matrix parameter buffers.
2012-01-27 13:28:11 +01:00
Gwenole Beauchesne
dbba1f6107 decoder: allow slices to be attached to pictures later. 2012-01-24 10:21:45 +01:00
Gwenole Beauchesne
74d3680381 decoder: add ref_count to GstVaapiPicture. 2012-01-24 10:15:52 +01:00
Zhao Halley
b963ccb929 profile: match video/x-h263 as H.263 Baseline profile.
HACK: qtdemux does not report profiles for H.263. So, assume plain
"video/x-h263" is H.263 Baseline profile.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-24 10:15:00 +01:00
Gwenole Beauchesne
c42ba571a8 display: report H.263 Baseline profile.
HACK: expose GST_VAAPI_PROFILE_H263_BASELINE for decoding if MPEG-4:2 Simple
profile (VAProfileMPEG4Simple) is supported.
2012-01-24 10:11:59 +01:00
Gwenole Beauchesne
29623239b9 Add template for workarounds. 2012-01-24 10:11:59 +01:00
Gwenole Beauchesne
0f511e1e0b surface: don't expose gst_vaapi_surface_get_parent_context().
gst_vaapi_surface_get_parent_context() was not meant to be exposed globally.
It's just an internal helper function. However, it's still possible to get
the parent context through the "parent-context" property.
2012-01-18 10:42:38 +01:00
Gwenole Beauchesne
92f11799d1 legal: fix year for some copyright notices. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
1594d99d55 legal: add Intel copyright on modified files. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
14cc1cf061 legal: fix copyright notices to include "Copyright" term. 2012-01-16 11:40:51 +01:00
Zhao Halley
c0d8f2fb1f mpeg4: replace GstVaapiTSB with GstAdapter (gst-plugins-base >= 0.10.24).
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Zhao Halley
6502783474 Add initial MPEG-4 decoder.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Sreerenj Balachandran
c3455e341e vc1: replace GstVaapiTSB with GstAdapter (gst-plugins-base >= 0.10.24).
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
6ae97634cf vc1: fix codec-data decoding for WMV3 format. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
7b1d784197 vc1: fix presentation timestamps. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
b5ab2e56a9 vc1: fix MV mode packing. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
a7ccbde2af vc1: handle codec-data. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
032486912f vc1: handle encapsulated bitstreams. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
5aea02a66f vc1: fix bitplanes decoding. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
e686c440c7 vc1: fix BFRACTION reconstruction. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
a6a1653d92 vc1: fix framerate calculation. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
b865d4a740 Add initial VC-1 decoder. 2012-01-16 11:40:51 +01:00
Zhao Halley
27fa5903ef mpeg2: fix first field detection.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
a591dc3b72 mpeg2: fix quantisation matrix construction. 2012-01-16 11:40:50 +01:00
Sreerenj Balachandran
697a2804e1 mpeg2: replace GstVaapiTSB API with GstAdapter (gst-plugins-base >= 0.10.24).
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
ab8f602957 mpeg2: fix packets spanning over two buffers. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
ce413eb83d mpeg2: ignore system start codes (PES headers). 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
c5902b7a84 mpeg2: handle closed_gop. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
49b4702fb6 Add initial MPEG-2 decoder. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
8f0eda8964 Allow conditional build of GStreamer/FFmpeg bitstream parsers. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
3360f7f3e3 Add VA decoder helpers. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
a93c1c076b decoder: add new error codes.
GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE: for unsupported profile
GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT: for unsupported chroma format
2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
9764e35acb Add timestamp buffer store helper utils. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
e0913aaf0e Add VA buffer helpers. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
9b9c049a67 utils: slight improvements to gl_bind_texture(). 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
30ef6802d6 utils: pretty-print output of gl_get_error_string(). 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
a3c9365f15 utils: rewrite gl_perspective() as per OpenGL FAQ 9.085. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
ba810c2ed6 utils: simplify string of VAProfile/VAEntrypoint. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
4340372996 utils: drop string_of_FOURCC() in favor of standard GST_FOURCC_* helpers. 2012-01-16 11:40:50 +01:00
Gwenole Beauchesne
674ea91faa display: always free VA display cache if it is empty. 2012-01-12 16:09:08 +01:00
Gwenole Beauchesne
9516f00f8e display: use VA display cache for X11 and GLX winsys. 2012-01-12 16:09:08 +01:00
Gwenole Beauchesne
773272475f display: implement a VA display cache. 2012-01-12 16:09:08 +01:00
Gwenole Beauchesne
420402d593 window: always check geometry when the window is mapped. 2012-01-11 09:38:56 +01:00
Zhao Halley
c40c05e5a4 Add missing profiles from VA-API 0.32.0.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-06 17:58:12 +01:00
Gwenole Beauchesne
3e1d235c1a decoder: fix possible leak of VA surfaces.
Under some circumstances, we could have leaked a surface, thus not
releasing it to the pool of available surfaces in the VA context.
The strategy is now to use a proxy earlier and automatically ref/unref
whenever necessary. In particular, during the lifetime needed for FFmpeg.
2012-01-05 17:35:43 +01:00
Gwenole Beauchesne
4e72aa587c surfaceproxy: add helper to retrieve the VA surface ID. 2012-01-05 17:35:43 +01:00
Gwenole Beauchesne
40f44ab60e surfaceproxy: simplify destruction.
Also make sure to always make sure to release the surface back to the
pool of surfaces in the associated VA context, if any.
2012-01-05 17:35:37 +01:00
Gwenole Beauchesne
0afd2e5c42 context: avoid self reference loops with surfaces. 2012-01-05 14:50:26 +01:00
Gwenole Beauchesne
7f8eaa6cbf image: add helpers to extract pixels to user buffers. 2012-01-05 10:29:48 +01:00
Gwenole Beauchesne
13f00c67e6 image: simplify initialization of raw images from video buffers. 2012-01-04 11:34:34 +01:00
Gwenole Beauchesne
ad390f3569 image: fix update from NV12 buffers. 2012-01-04 11:32:21 +01:00
Gwenole Beauchesne
ac7c4cfe78 surface: apply composition to the parent context, if requested. 2011-12-14 14:40:37 +01:00
Gwenole Beauchesne
17538a340e context: make it possible to apply composition globally. 2011-12-14 14:35:13 +01:00
Gwenole Beauchesne
0634dc768d surface: fix associate subpicture to not report deassociation errors. 2011-12-14 14:13:58 +01:00
Gwenole Beauchesne
bf63fe671f surface: fix typo in debug message. 2011-12-14 13:46:26 +01:00
Gwenole Beauchesne
3227168487 subpicture: add helper to create subpicture from GstVideoOverlayRectangle. 2011-12-14 13:16:21 +01:00
Gwenole Beauchesne
317c4e639e surface: record parent context. 2011-12-13 16:53:15 +01:00
Gwenole Beauchesne
9c8c33857f Fix warnings. 2011-12-13 15:59:02 +01:00
Gwenole Beauchesne
a4244820af Rename gst_vaapi_surface_update_composition() to
gst_vaapi_surface_set_subpictures_from_composition().
2011-12-13 15:51:58 +01:00
Nicolas Dufresne
f6fb267903 converter: add support for GstVideoOverlayComposition planes.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-12 18:38:51 +01:00
Gwenole Beauchesne
b014567502 surface: use unscaled overlay rectangle for blending. 2011-12-12 18:38:46 +01:00
Gwenole Beauchesne
010f94b85d surface: fix VA image leak when an error occurred. 2011-12-12 18:37:13 +01:00
Nicolas Dufresne
c997607c6f surface: add helper to handle GstVideoOverlayComposition.
This helper resets the subpictures to reflect the current composition
layers provided with the buffers.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-12 18:34:57 +01:00
Gwenole Beauchesne
55738da35b image: add gst_vaapi_image_format_from_video() helper. 2011-12-12 18:32:29 +01:00
Gwenole Beauchesne
efcdec08fb image: allow updates from GstVaapiImageRaw. 2011-12-12 18:32:29 +01:00
Gwenole Beauchesne
9337fb9a74 image: allow partial updates. 2011-12-12 18:32:29 +01:00
Gwenole Beauchesne
6352c7d5fa subpicture: fix doc for gst_vaapi_subpicture_set_image(). 2011-12-12 18:32:29 +01:00
Gwenole Beauchesne
697b96c30c display: fix has_image_format() to check against subpicture formats. 2011-12-12 15:09:37 +01:00
Gwenole Beauchesne
e3c6a78da6 decoder: drop unused headers. 2011-12-08 15:16:14 +01:00
Nicolas Dufresne
c5b18c27d5 videobuffer: add GLX buffer support.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-08 15:13:35 +01:00
Nicolas Dufresne
a6717334f9 Port to GstSurfaceBuffer interface.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-08 14:58:58 +01:00
Nicolas Dufresne
075374cda3 Change caps to use new video/x-surface generic type.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-08 14:58:58 +01:00
Nicolas Dufresne
99c5d18f41 Port to GstVideoContext interface.
This new interface allows for upstream and downstream display sharing
that works in both static and dynamic pipelines.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-08 14:58:58 +01:00
Nicolas Dufresne
e5abbe0440 display: destroy display on creation failure.
This allows element to detect that the display creation has actually
failed.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-07 17:20:55 +01:00
Nicolas Dufresne
8a1dc4978f display: don't crash when config is empty.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-07 17:19:42 +01:00
Gwenole Beauchesne
3b9a165037 decoder: fix use of invalid data at the end-of-stream. 2011-10-19 17:33:36 +02:00
Gwenole Beauchesne
bd74adeffa Cosmetics (sort source files). 2011-09-14 11:40:02 +02:00
Gwenole Beauchesne
857a024c62 Fix gst_vaapi_image_new_with_image(). 2011-09-08 14:51:30 +02:00
Gwenole Beauchesne
e00ec1f576 Add gst_vaapi_video_buffer_new_from_buffer().
Add helper function to bind a foreign buffer into a GstVaapiVideoBuffer.
Any image, surface or surface proxy will be inherited from the source buffer
if it is a GstVaapiVideoBuffer.
2011-09-06 18:37:11 +02:00
Gwenole Beauchesne
00bb1ca6b4 Add Intel copyright information. 2011-08-01 14:15:39 +02:00
Gwenole Beauchesne
a9a9d72e96 Fix build with newer FFmpeg versions. 2011-07-22 15:56:22 +02:00
Gwenole Beauchesne
2f91c9e8c1 Report caps update only once per video resolution change. 2011-07-22 15:42:26 +02:00
Gwenole Beauchesne
ab6efa04ca Add canonical form (type name) of VA surface caps. 2011-07-22 15:42:26 +02:00
Gwenole Beauchesne
1701ce3107 Update copyright notice. 2011-06-14 13:54:07 +02:00
Gwenole Beauchesne
b614ec9c9b Fix licensing terms. 2011-06-14 13:54:03 +02:00
gb
8ee1ffa857 Drop the GLX 1.3 requirement. 2010-09-20 12:55:47 +02:00
gb
982a06b1c7 Call the GLX/Pixmap related functions through the vtable. 2010-09-20 12:55:47 +02:00
gb
fcb65d60f5 Drop dependency on libavformat. 2010-09-20 12:55:47 +02:00
gb
d1332bc2e1 Fix GLX version check. 2010-09-20 12:55:47 +02:00
gb
6735dc6b68 Fix decoding of some H.264 streams. e.g. Ice Age 2 trailer. 2010-09-20 12:55:47 +02:00
gb
ade43e8016 Fix build with older VA-API 0.29-sds. 2010-09-20 12:55:47 +02:00
gb
fa6385cd39 Fix decoder caps to report codec aliases. 2010-09-20 12:55:46 +02:00
gb
86d0b2ade9 Regularly update and expose decoder caps. 2010-09-20 12:55:46 +02:00
gb
a777a98f2f Add mechanism to reinsert buffer leftovers into the queue. 2010-09-20 12:55:46 +02:00
gb
9a3b4a7844 Fix memory leak of encoded buffers. 2010-09-20 12:55:46 +02:00
gb
5e8e268e26 Check for out-of-free-surfaces condition. 2010-09-20 12:55:46 +02:00
gb
0047bb1553 Change GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN value to something more generic (-1). 2010-09-20 12:55:46 +02:00
gb
0fb0c49dbb Improve previous fix. 2010-09-20 12:55:46 +02:00
gb
d5df97625e Fix a crash in the FFmpeg decoder on close. 2010-09-20 12:55:46 +02:00
gb
0e0426582e Fix OpenGL texture internal format (Clutter). 2010-09-20 12:55:46 +02:00
gb
91c4c2c6b5 Fix comment. 2010-09-20 12:55:45 +02:00
gb
453164d0c5 Add gst_vaapi_display_lookup_downstream() helper. 2010-09-20 12:55:45 +02:00
gb
39dbd70c8f Expose VA display through GstVaapiVideoBuffer. 2010-09-20 12:55:45 +02:00
gb
6f5e593abd Expose video pool display. 2010-09-20 12:55:45 +02:00
gb
bceab0254c Stop iteration if there is no more element to examine. 2010-09-20 12:55:44 +02:00
gb
80e5b1ba17 Factor out VA surface caps. 2010-09-20 12:55:44 +02:00
gb
e739b7a289 Fix docs. 2010-09-20 12:55:44 +02:00
gb
01af005ec2 Really link all helper libraries with libtool -no-undefined. 2010-09-20 12:55:44 +02:00
gb
eec67a5972 Link helper libraries with libtool -no-undefined. 2010-09-20 12:55:44 +02:00
gb
85466028ad Fix build with older VA-API 0.29. 2010-09-20 12:55:44 +02:00
gb
79c34f823b Fix doc. 2010-09-20 12:55:44 +02:00
gb
f6314162e0 Rename gst_vaapi_decoder_ffmpeg_new_from_caps() to plain gst_vaapi_decoder_ffmpeg_new(). 2010-09-20 12:55:44 +02:00
gb
edae9f068c Extract framerate information from caps. 2010-09-20 12:55:44 +02:00
gb
2d5434cb0b Move caps initialization to parent class. 2010-09-20 12:55:43 +02:00
gb
5851086b92 Simplify. 2010-09-20 12:55:43 +02:00
gb
fe35801572 Fix doc. 2010-09-20 12:55:43 +02:00
gb
09552b1559 More simplifications. 2010-09-20 12:55:43 +02:00
gb
73766f9466 Simplify GstVaapiDecoder API. 2010-09-20 12:55:43 +02:00
gb
5128ed9951 Drop obsolete defs. 2010-09-20 12:55:43 +02:00
gb
bcf57bb4f9 Drop obsolete decls. 2010-09-20 12:55:43 +02:00
gb
e39709453e Add more aliases for MPEG-4 decoding. 2010-09-20 12:55:43 +02:00
gb
1a341a1c02 Use avctx->coded_{width,height} info to create the VA context. 2010-09-20 12:55:43 +02:00
gb
24d918b7a3 Try to improve heuristics to use an AVCodecContextParser. 2010-09-20 12:55:43 +02:00
gb
dbe1d622ef Fix VC-1 decoding, it does not require any specific parser. 2010-09-20 12:55:43 +02:00
gb
ffb74abe0f Fix VC-1 detection with older gstreamer libs (no "fourcc" field, but a "format" one). 2010-09-20 12:55:43 +02:00
gb
4285c2cc02 Use size information from the demuxer, whenever available. i.e. fix WMV3 decoding. 2010-09-20 12:55:43 +02:00
gb
477e3b8530 Add gst_vaapi_decoder_ffmpeg_new_from_caps() helper. 2010-09-20 12:55:42 +02:00
gb
fa7505c0c5 Improve WMV3 detection yet further. 2010-09-20 12:55:42 +02:00
gb
64479eb8f2 Fix detection of plain old WMV3 contents. 2010-09-20 12:55:42 +02:00
gb
587b39cdd5 Fix VC-1 detection. 2010-09-20 12:55:42 +02:00
gb
34764d2c2c Fix build with older gstreamer libs where gst_buffer_unref() is not a plain function. 2010-09-20 12:55:42 +02:00
gb
021d2ab947 Drop obsolete (and wrong) code. 2010-09-20 12:55:42 +02:00
gb
26790878a1 Cosmetics (spelling). 2010-09-20 12:55:42 +02:00
gb
ecff33db03 Try to fix timestamps (step 1). Looks OK on H55. 2010-09-20 12:55:42 +02:00
gb
4754317e70 Relicense gst-libs/ code to LGPL v2.1+. 2010-09-20 12:55:42 +02:00
gb
8d9b365a5b Drop extraneous comma. 2010-09-20 12:55:42 +02:00