Gwenole Beauchesne [Fri, 20 Dec 2013 14:15:05 +0000 (15:15 +0100)]
display: don't use GstCaps for image or subpicture formats list.
Replace gst_vaapi_display_get_{image,subpicture}_caps() APIs, that
returned GstCaps, with more convenient APIs that return an array of
GstVideoFormat: gst_vaapi_display_get_{image,subpicture}_formats().
Gwenole Beauchesne [Fri, 20 Dec 2013 13:01:45 +0000 (14:01 +0100)]
display: allocate queried resources on-demand.
Allocate the set of decoders or encoders on-demand, when they are
queried. Likewise for VA display attributes, image and subpicture
formats.
Gwenole Beauchesne [Fri, 20 Dec 2013 12:27:07 +0000 (13:27 +0100)]
display: re-indent all GstVaapiDisplay related source code.
Gwenole Beauchesne [Fri, 20 Dec 2013 15:04:19 +0000 (16:04 +0100)]
utils: add helper functions to get codec or profile name.
Gwenole Beauchesne [Fri, 20 Dec 2013 16:08:23 +0000 (17:08 +0100)]
plugins: fix permissions for certain files.
Drop the execute bit for gstvaapiuploader.c and gstvaapipostproc.[ch]
files.
Matthieu Bouron [Thu, 12 Dec 2013 17:01:29 +0000 (17:01 +0000)]
plugins: implement GLTextureUploadMeta user data copy.
Makes the copies of a buffer reference their own GLTextureUploadMeta
user data and prevent the original buffer accessing already freed
memory if its copies has been released and freed.
https://bugzilla.gnome.org/show_bug.cgi?id=720336
[Propagate the original meta texture to the copy too]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Tue, 17 Dec 2013 17:52:23 +0000 (18:52 +0100)]
plugins: factor out support for raw YUV buffers on sink pads.
Factor out propose_allocation() hooks, creation of video buffer pool
for the sink pad, conversion from raw YUV buffers to VA surface backed
buffers. Update vaapidecode, vaapiencode and vaapipostproc to cope
with the new GstVaapiPluginBase abilities.
Gwenole Beauchesne [Tue, 17 Dec 2013 17:46:07 +0000 (18:46 +0100)]
plugins: factor out pad caps.
Gwenole Beauchesne [Fri, 13 Dec 2013 15:03:08 +0000 (16:03 +0100)]
plugins: factor out video context sharing code.
Gwenole Beauchesne [Fri, 13 Dec 2013 12:24:24 +0000 (13:24 +0100)]
plugins: factor out GstImplementsInterface.
Gwenole Beauchesne [Fri, 13 Dec 2013 11:00:35 +0000 (12:00 +0100)]
plugins: check type of display obtained from neighbours.
Fix display creation code to check that any display obtained from a
neighbour actually has the type we expect. Note: if display type is
set to "any", we can then accept any VA display type.
Gwenole Beauchesne [Fri, 13 Dec 2013 10:52:47 +0000 (11:52 +0100)]
plugins: factor out display creation process.
Move common VA display creation code to GstVaapiPluginBase, with the
default display type remaining "any". Also add a "display-changed"
hook so that subclasses could perform additional tasks when/if the
VA display changed, due to a new display type request for instance.
All plug-ins are updated to cope with the new internal APIs.
Gwenole Beauchesne [Fri, 13 Dec 2013 09:24:26 +0000 (10:24 +0100)]
plugins: add new base object, store display in there.
Introduce a new GstVaapiPluginBase object that will contain all common
data structures and perform all common tasks. First step is to have a
single place to hold VA displays.
While we are at it, also make sure to store and subsequently release
the appropriate debug category for the subclasses.
Gwenole Beauchesne [Wed, 11 Dec 2013 13:04:27 +0000 (14:04 +0100)]
plugins: fix GLTextureUploadMeta to work with different texture ids.
The GLTextureUploadMeta implementation assumed that for each upload()
sequence, the supplied texture id is always the same as the one that
was previously cached into the underlying GstVaapiTexture. Cope with
any texture id change the expense to recreate the underlying VA/GLX
resources.
https://bugzilla.gnome.org/show_bug.cgi?id=719643
Gwenole Beauchesne [Wed, 11 Dec 2013 12:25:51 +0000 (13:25 +0100)]
plugins: allow builds without GLX enabled for GStreamer 1.2.
Don't try to build GLTextureUploadMeta related code if GLX is not
enabled during GStreamer >= 1.2 builds.
Matthieu Bouron [Wed, 20 Nov 2013 17:20:07 +0000 (17:20 +0000)]
plugins: request GLTextureUpload meta on buffers in the buffer pool.
Requesting the GLTextureUpload meta on buffers in the bufferpool
prevents such metas from being de-allocated when buffers are released
in the sink.
This is particulary useful in terms of performance when using the
GLTextureUploadMeta API since the GstVaapiTexture associated with
the target texture is stored in the meta.
https://bugzilla.gnome.org/show_bug.cgi?id=712558
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Wed, 11 Dec 2013 09:51:03 +0000 (10:51 +0100)]
plugins: robustify GstVideoGLTextureUploadMeta implementation.
Make GstVideoGLTextureUploadMeta::upload() implementation more robust
when the GstVaapiTexture associated with the supplied texture id could
not be created.
Gwenole Beauchesne [Tue, 10 Dec 2013 15:14:27 +0000 (16:14 +0100)]
h264: improve robustness when packets are missing.
Improve robustness when some expected packets where not received yet
or that were not correctly decoded. For example, don't try to decode
a picture if there was no valid frame headers parsed so far.
https://bugs.freedesktop.org/show_bug.cgi?id=57902
Gwenole Beauchesne [Tue, 10 Dec 2013 13:20:55 +0000 (14:20 +0100)]
decoder: h264: fix decoding of BA3_SVA_C.264.
Conformance test Base_Ext_Main_profiles/BA3_SVA_C.264 complys with
extended profile specifications. However, the SPS header has the
constraint_set1_flag syntax element set to 1. This means that, if
a Main profile compliant decoder is available, then it should be
able to decode this stream.
This changes makes it possible to fall-back from Extended profile
to Main profile if constraint_set1_flag is set to 1.
https://bugzilla.gnome.org/show_bug.cgi?id=720190
Gwenole Beauchesne [Tue, 10 Dec 2013 10:13:01 +0000 (11:13 +0100)]
utils: h264: add more profiles.
Add extended profile (A.2.3), high 4:2:2 profile (A.2.6), high 4:2:2
profiles (A.2.7, A.2.10), scalable profiles (G.10.1.1, G.10.1.2) and
multiview profiles (H.10.1.1, H.10.1.2).
Document "Constrained Baseline" and "High 10" profiles.
Gwenole Beauchesne [Tue, 10 Dec 2013 14:21:51 +0000 (15:21 +0100)]
codecparsers: update to gst-vaapi-branch commit e7d0e18.
e7d0e18 h264: complete set of NAL unit types
Wind Yuan [Fri, 6 Dec 2013 07:08:26 +0000 (15:08 +0800)]
decoder: h264: add support for constrained baseline profile.
Recognize streams marked as conforming to the "Constrained Baseline
Profile". If VA driver supports that as is, fine. Otherwise, fallback
to baseline, main or high profile.
Constrained Baseline Profile conveys coding tools that are common
to baseline profile and main profile.
https://bugzilla.gnome.org/show_bug.cgi?id=719947
[Added fallbacks to main and high profiles]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Mon, 9 Dec 2013 11:46:45 +0000 (12:46 +0100)]
decoder: h264: fix decoding of scaling lists.
The GStreamer codecparser layer now parses the scaling lists in zigzag
scan order, as expected, so that to match the original bitstream layout
and specification. However, further convert the scaling lists into
raster scan order to fit the existing practice in most VA drivers.
https://bugzilla.gnome.org/show_bug.cgi?id=706406
Gwenole Beauchesne [Mon, 9 Dec 2013 11:07:28 +0000 (12:07 +0100)]
codecparsers: update to gst-vaapi-branch commit 177c73b.
a7e3255 add H.265 (HEVC) bitstream parser
177c73b h264: fix picture level scaling lists derivation (rule B)
14733f1 h264: fix parsing of VCL HRD parameters
59a0b47 h264: store quantization matrices in zig-zag order
ffb6e26 h264: add helpers to convert quantization matrices
c78a504 mpeg2: also initialize debug category in parse_sequence_header()
719d1b0 mpeg2: turn internal consistency check into a g_assert()
5241d8e all: remove some unused functions
18eb312 all: fix for GST_DISABLE_GST_DEBUG
963c04a all: make warnings more meaningful
Gwenole Beauchesne [Fri, 6 Dec 2013 18:05:52 +0000 (19:05 +0100)]
utils: add helpers for H.264 levels.
- gst_vaapi_utils_h264_get_level():
Returns GstVaapiLevelH264 from H.264 level_idc value
- gst_vaapi_utils_h264_get_level_idc():
Returns H.264 level_idc value from GstVaapiLevelH264
- gst_vaapi_utils_h264_get_level_limits():
Returns level limits as specified in Table A-1 of the H.264 standard
- gst_vaapi_utils_h264_get_level_limits_table():
Returns the Table A-1 specification
Gwenole Beauchesne [Fri, 6 Dec 2013 16:34:52 +0000 (17:34 +0100)]
utils: add new H.264 profiles.
Add "Constrained Baseline Profile" and "High 10 Profile" definitions
and helper functiions.
Gwenole Beauchesne [Fri, 6 Dec 2013 16:21:52 +0000 (17:21 +0100)]
utils: add new H.264 helper functions.
* Profiles:
- gst_vaapi_utils_h264_get_profile():
Returns GstVaapiProfile from H.264 profile_idc value
- gst_vaapi_utils_h264_get_profile_idc():
Returns H.264 profile_idc value from GstVaapiProfile
* Chroma formats:
- gst_vaapi_utils_h264_get_chroma_type():
Returns GstVaapiChromaType from H.264 chroma_format_idc value
- gst_vaapi_utils_h264_get_chroma_format_idc():
Returns H.264 chroma_format_idc value from GstVaapiChromaType
Matthieu Bouron [Tue, 3 Dec 2013 11:05:17 +0000 (11:05 +0000)]
Fix missing files in distribution tarball.
https://bugzilla.gnome.org/show_bug.cgi?id=719776
[Additional fixes and clean-ups]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Thu, 5 Dec 2013 17:13:54 +0000 (18:13 +0100)]
encoder: fix computation of max coded buffer size (again).
The previous fix was only valid to express the maximum size of the
macroblock layer, i.e. without any headers. Now, also account for
the slice headers and top picture header, but also any other header
we might stuff into the VA coded buffer, e.g. sequence headers.
Gwenole Beauchesne [Wed, 4 Dec 2013 18:10:13 +0000 (19:10 +0100)]
encoder: fix computation of max coded buffer size.
Fix coded buffer size for each codec. A generic issue was that the
number of macroblocks was incorrectly computed. The second issue was
specific to MPEG-2 were the max number of bits per macroblock, and
as defined by the standard, was incorrectly mapped to the (lower)
H.264 requirement. i.e. 4608 bits vs. 3200 bits limit.
Gwenole Beauchesne [Wed, 4 Dec 2013 17:48:35 +0000 (18:48 +0100)]
encoder: simplify VA context initialization process.
Change get_context_info() into a set_context_info() function that
initializes common defaults into the base class, thus allowing the
subclasses to specialize the context info further on.
The set_context_info() hook is also the location where additional
context specific data could be initialized. At this point, we are
guaranteed to have valid video resolution size and framerate. i.e.
gst_vaapi_encoder_set_format() was called beforehand.
Wind Yuan [Tue, 26 Nov 2013 06:38:23 +0000 (14:38 +0800)]
encoder: fix mpeg2 compilation error.
https://bugzilla.gnome.org/show_bug.cgi?id=719746
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Wed, 4 Dec 2013 16:55:18 +0000 (17:55 +0100)]
encoder: clean-ups and document public APIs.
Clean public APIs up so that to better align with the decoder APIs.
Most importantly, gst_vaapi_encoder_get_buffer() is changed to only
return the VA coded buffer proxy. Also provide useful documentation
for the public APIs.
Gwenole Beauchesne [Wed, 4 Dec 2013 16:05:17 +0000 (17:05 +0100)]
encoder: avoid extra allocations of GstVaapiEncoderSyncPic objects.
Kill GstVaapiEncoderSyncPic objects that are internally and temporarily
allocated. Rather, associate a GstVaapiEncPicture to a coded buffer
through GstVaapiCodedBufferProxy user-data facility.
Besides, use a GAsyncQueue to maintain a thread-safe queue object of
coded buffers.
Partial fix for the following report:
https://bugzilla.gnome.org/show_bug.cgi?id=719530
Gwenole Beauchesne [Tue, 3 Dec 2013 16:04:43 +0000 (17:04 +0100)]
encoder: refactor status codes.
Drop obsolete or unused status codes. Align some status codes with the
decoder counterparts.
Gwenole Beauchesne [Wed, 4 Dec 2013 10:54:40 +0000 (11:54 +0100)]
encoder: fix subclassing process.
Fix the GstVaapiEncoderClass parent class type. Make sure to validate
subclass hooks as early as possible, i.e. in gst_vaapi_encoder_init(),
thus avoiding useless run-time checks. Also simplify the subclass
initialization process to be less error prone.
Gwenole Beauchesne [Tue, 3 Dec 2013 15:11:46 +0000 (16:11 +0100)]
encoder: rework GstVaapiCodedBuffer and related proxy.
Refactor the GstVaapiCodedBuffer APIs so that to more clearly separate
public and private interfaces. Besides, the map/unmap APIs should not
be exposed as is but appropriate accessors should be provided instead.
* GstVaapiCodedBuffer: VA coded buffer abstraction
- gst_vaapi_coded_buffer_get_size(): get coded buffer size.
- gst_vaapi_coded_buffer_copy_into(): copy coded buffer into GstBuffer
* GstVaapiCodedBufferPool: pool of VA coded buffer objects
- gst_vaapi_coded_buffer_pool_new(): create a pool of coded buffers of
the specified max size, and bound to the supplied encoder
* GstVaapiCodedBufferProxy: pool-allocated VA coded buffer object proxy
- gst_vaapi_coded_buffer_proxy_new_from_pool(): create coded buf from pool
- gst_vaapi_coded_buffer_proxy_get_buffer(): get underlying coded buffer
- gst_vaapi_coded_buffer_proxy_get_buffer_size(): get coded buffer size
Rationale: more optimized transfer functions might be provided in the
future, thus rendering the map/unmap mechanism obsolete or sub-optimal.
https://bugzilla.gnome.org/show_bug.cgi?id=719775
Gwenole Beauchesne [Fri, 29 Nov 2013 13:02:52 +0000 (14:02 +0100)]
plugins: fix reference leaks of VA display objects.
Fix GstElement::set_context() implementation for all plug-in elements
to avoid leaking an extra reference to the VA display, thus preventing
correct cleanup of VA resources in GStreamer 1.2 builds.
Gwenole Beauchesne [Fri, 29 Nov 2013 12:56:12 +0000 (13:56 +0100)]
plugins: simplify gst_vaapi_ensure_display().
Return earlier if the creation of a VA display failed. Likewise, simplify
gst_vaapi_video_context_propagate() now that we are guaranteed to have a
valid VA display.
Gwenole Beauchesne [Thu, 28 Nov 2013 18:08:28 +0000 (19:08 +0100)]
plugins: fix memory leaks through GstVideoMeta maps.
When GstVideoMeta maps were used, the supporting functions incorrectly
used gst_buffer_get_memory() instead of gst_buffer_peek_memory(), thus
always increasing the associated GstMemory reference count and giving
zero chance to actually release that, and subsequently the VA display.
Gwenole Beauchesne [Thu, 28 Nov 2013 13:15:44 +0000 (14:15 +0100)]
plugins: use G_PARAM_STATIC_STRINGS.
This avoids a few string copies during initialization.
Gwenole Beauchesne [Thu, 28 Nov 2013 16:28:11 +0000 (17:28 +0100)]
plugins: simplify VA video meta to only reference surface proxies.
Simplify GstVaapiVideoMeta to only hold a surface proxy, which is
now allocated from a surface pool. This also means that the local
reference to the VA surface is also gone, as it could be extracted
from the associated surface proxy.
Gwenole Beauchesne [Thu, 28 Nov 2013 15:51:37 +0000 (16:51 +0100)]
plugins: drop obsolete functions.
Drop the following functions that are not longer used:
- gst_vaapi_video_buffer_new_with_surface()
- gst_vaapi_video_meta_new_with_surface()
- gst_vaapi_video_meta_set_surface()
- gst_vaapi_video_meta_set_surface_from_pool()
Gwenole Beauchesne [Thu, 28 Nov 2013 15:37:31 +0000 (16:37 +0100)]
plugins: allow VA video meta to be allocated from surface proxy pools.
Fix gst_vaapi_video_meta_new_from_pool() to allocate VA surface proxies
from surface pools instead of plain VA surfaces. This is to simplify
allocations now that surface proxies are created from a surface pool.
Gwenole Beauchesne [Thu, 28 Nov 2013 16:25:05 +0000 (17:25 +0100)]
surfaceproxy: add copy function.
Add gst_vaapi_surface_proxy_copy() function that creates a new surface
proxy with the same information from the parent proxy, except that the
user-defined destroy notify function is not copied over.
The underlying VA surface is pushed back to the video pool only when
the last reference to the parent surface proxy is released.
Gwenole Beauchesne [Thu, 28 Nov 2013 14:56:53 +0000 (15:56 +0100)]
vaapiencode: optimize _handle_frame() to avoid extra allocation.
Optimize gst_vaapiencode_handle_frame() to avoid extra memory allocation,
and in particular the GstVaapiEncObjUserData object. i.e. directly use
the VA surface proxy from the source buffer. This also makes the user
data attached to the GstVideoCodecFrame more consistent between both
the decoder and encoder plug-in elements.
Gwenole Beauchesne [Thu, 28 Nov 2013 14:14:43 +0000 (15:14 +0100)]
vaapiencode: fix memory leaks in _push_frame() on error.
Simplify gst_vaapiencode_push_frame(), while also removing the call
to gst_video_encoder_negotiate() since this is implicit in _finish()
if caps changed. Also fixed memory leaks that occured on error.
Gwenole Beauchesne [Thu, 28 Nov 2013 12:57:54 +0000 (13:57 +0100)]
vaapiencode: additional clean-ups.
Constify pointers wherever possible. Drop unused variables, and use
consistent variable names. Fix gst_vaapiencode_h264_allocate_buffer()
to correctly report errors, especially when in-place conversion from
bytestream to avcC format failed.
Gwenole Beauchesne [Thu, 28 Nov 2013 12:26:40 +0000 (13:26 +0100)]
vaapiencode: move common properties to base class.
Move "rate-control" mode and "bitrate" properties to the GstVaapiEncode
base class. The actual range of supported rate control modes is currently
implemented as a plug-in element hook. This ought to be determined from
the GstVaapiEncoder object instead, i.e. from libgstvaapi.
Gwenole Beauchesne [Thu, 28 Nov 2013 09:54:36 +0000 (10:54 +0100)]
vaapiencode: fix plugin description and debug name.
Align the plug-in debug category to its actual name. i.e. enable debug
logs through vaapiencode_<CODEC> where <CODEC> is mpeg2, h264, etc. Fix
the plug-in element description to make it more consistent with other
VA-API plug-ins.
Gwenole Beauchesne [Wed, 27 Nov 2013 15:27:31 +0000 (16:27 +0100)]
vaapiencode: add initial support for GStreamer 0.10.
Gwenole Beauchesne [Wed, 27 Nov 2013 15:25:59 +0000 (16:25 +0100)]
libs: add more GstBuffer compat glue for GStreamer 0.10.
Add gst_buffer_new_allocate() and gst_buffer_fill() implementations.
Fix gst_buffer_new_wrapped_full() implementation to handle the destroy
notify function.
Gwenole Beauchesne [Wed, 27 Nov 2013 14:56:51 +0000 (15:56 +0100)]
libs: always use built-in videoutils for GStreamer 0.10.
GStreamer 0.10.36 is the latest and ultimate version to be released
from the GStreamer 0.10 branch. i.e. no further releases are to be
made. So, we can safely enable the built-in videoutils replacement
now that they are in sync with the 0.10 branch.
Gwenole Beauchesne [Wed, 27 Nov 2013 14:47:38 +0000 (15:47 +0100)]
videoutils: update to master commit d4a15a5.
d4a15a5 video: fix compiler warning in header with C++11 / clang-3.1
86096cc videodecoder: minor cosmetic changes to align a bit more with master
b4b8b52 videodecoder: allow parse function to not use all data on adapter
2145495 videodecoder: warn if frame list gets long
36c3753 videodecoder: Also use the object lock to protect the output_state
518c93d videodecoder: fix seeking again
185fb63 video: Correct usage of the base class stream lock
170e944 videodecoder: Expose _negotiate function
Matthieu Bouron [Tue, 26 Nov 2013 12:06:07 +0000 (12:06 +0000)]
Fix build with GStreamer >= 1.3.
http://bugzilla.gnome.org/show_bug.cgi?id=715183
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Tue, 26 Nov 2013 16:56:59 +0000 (17:56 +0100)]
configure: disable encoders with GStreamer 0.10.
Don't try to build video encoders for GStreamer 0.10. Support code is
not there yet, and probably will never for such an ancient version.
Gwenole Beauchesne [Tue, 26 Nov 2013 16:26:44 +0000 (17:26 +0100)]
vaapiencode: fix error handling while allocating output buffers.
Fix default GstVideoEncoder::allocate_buffer() implementation to properly
unmap the coded buffer prior to returning an error.
Gwenole Beauchesne [Tue, 26 Nov 2013 16:11:22 +0000 (17:11 +0100)]
vaapiencode: fix error handling in _finish() hook.
Fix GstVideoEncoder::finish() implementation to really return possible
errors instead of GST_FLOW_OK. That is, fix check for timeout status.
Gwenole Beauchesne [Tue, 26 Nov 2013 15:34:14 +0000 (16:34 +0100)]
vaapiencode: minor clean-ups.
Add a GST_VAAPIENCODE_CAST() helper to avoid run-time checks against
the GObject type system. We are guaranteed to only deal with the same
plug-in element object.
Gwenole Beauchesne [Tue, 26 Nov 2013 14:31:03 +0000 (15:31 +0100)]
vaapiencode: fix support for raw YUV sink buffers.
Allow vaapiencode plug-in elements to encode from raw YUV buffers.
The most efficient way to do so is to let the vaapiencode elements
allocate a buffer pool, and subsequently buffers from it. This means
that upstream elements are expected to honour downstream pools.
If upstream elements insist on providing their own allocated buffers
to the vaapiencode elements, then it possibly would be more efficient
to insert a vaapipostproc element before the vaapiencode element.
This is because vaapipostproc currently has better support than other
elements for "foreign" raw YUV buffers.
Gwenole Beauchesne [Tue, 26 Nov 2013 14:12:59 +0000 (15:12 +0100)]
vaapiencode: fix support for GStreamer 1.2.
Wind Yuan [Thu, 7 Nov 2013 09:42:21 +0000 (17:42 +0800)]
vaapiencode: initial port to GStreamer 1.2.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
XuGuangxin [Wed, 20 Nov 2013 08:21:32 +0000 (16:21 +0800)]
plugins: add mpeg2 encoder element.
Add GstVaapiEncodeMPEG2 element object. The actual plug-in element
is called "vaapiencode_mpeg2".
Valid properties:
- rate-control: rate control mode (default: cqp - constant QP)
- bitrate: desired bitrate in kbps (default: auto-calculated)
- key-period: maximal distance between two key frames (default: 30)
- max-bframes: number of B-frames between I and P (default: 2)
- quantizer: constant quantizer (default: 8)
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Wind Yuan [Mon, 29 Jul 2013 08:02:56 +0000 (16:02 +0800)]
plugins: add h264 encoder element.
Add GstVaapiEncodeH264 element object. The actual plug-in element
is called "vaapiencode_h264".
Valid properties:
- rate-control: rate control mode (default: none)
- bitrate: desired bitrate in kbps (default: auto-calculated)
- key-period: maximal distance between two key frames (default: 30)
- num-slices: number of slices per frame (default: 1)
- max-bframes: number of B-frames between I and P (default: 0)
- min-qp: minimal quantizer (default: 1)
- init-qp: initial quantizer (default: 26)
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Wind Yuan [Mon, 29 Jul 2013 05:44:48 +0000 (13:44 +0800)]
plugins: add base encoder element.
vaapiencode element is based on GstVideoEncoder APIs.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
XuGuangxin [Wed, 20 Nov 2013 08:20:15 +0000 (16:20 +0800)]
encoder: add mpeg2 encoder.
Add initial support for MPEG-2 encoding. I/P/B frames are supported.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Wind Yuan [Mon, 29 Jul 2013 07:46:11 +0000 (15:46 +0800)]
encoder: add h264 encoder.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Wind Yuan [Mon, 29 Jul 2013 05:34:06 +0000 (13:34 +0800)]
Add initial infrastructure for video encoding.
Add initial API for video encoding: only basic interfaces and small
encoder objects are implemented so far.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Wind Yuan [Mon, 29 Jul 2013 07:41:23 +0000 (15:41 +0800)]
libs: add generic bitstream writer.
GstBitWriter provides a bit writer that can write any number of bits
to a pre-allocated memory buffer. Helper functions are also provided
to write any number of bits from 8, 16, 32 and 64 bit variables.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Wind Yuan [Fri, 12 Jul 2013 14:07:59 +0000 (22:07 +0800)]
libs: add support for rate-control to GstVaapiContext.
Extend GstVaapiContextInfo structure to hold the desired rate control
mode for encoding purposes. For decoding purposes, this field is not
used and it is initialized to GST_VAAPI_RATECONTROL_NONE.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Wind Yuan [Fri, 12 Jul 2013 13:33:32 +0000 (21:33 +0800)]
libs: add rate-control attributes.
Add GstVaapiRateControl types and GType values in view to supporting
rate controls for encoding. This is meant to be used for instance in
GstVaapiContext.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Fri, 22 Nov 2013 10:56:51 +0000 (11:56 +0100)]
Bump version for development.
Gwenole Beauchesne [Fri, 22 Nov 2013 10:28:09 +0000 (11:28 +0100)]
build: fix for Wayland headers not in standard include dirs.
Fix build when Wayland headers don't live in plain system include dirs
like /usr/include but rather in /usr/include/wayland for instance.
Original patch written by Dominique Leuenberger <dimstar@opensuse.org>
https://bugzilla.gnome.org/show_bug.cgi?id=712282
Ross Burton [Thu, 14 Nov 2013 10:58:37 +0000 (10:58 +0000)]
build: link libgstvaapi-wayland against videoutils.
This library is using symbols that don't exist in GStreamer 0.10 so
it needs to link to built-in implementation (libgstvaapi-videoutils).
https://bugzilla.gnome.org/show_bug.cgi?id=712282
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Fri, 22 Nov 2013 10:15:57 +0000 (11:15 +0100)]
vaapostproc: fix memory leaks.
Destroy VPP output surface pool on exit. Also avoid a possible crash
in double-free situation caused by insufficiently reference counted
array of formats returned during initialization.
Gwenole Beauchesne [Fri, 22 Nov 2013 09:19:06 +0000 (10:19 +0100)]
vaapipostproc: fix and optimize advanced deinterlacing mode.
Fix advanced deinterlacing modes with VPP to track only up to 2 past
reference buffers. This used to be 3 past reference buffers but this
doesn't fit with the existing decode pipeline that only has 4 extra
scratch surfaces.
Also optimize references tracking to be only enabled when needed, i.e.
when advanced deinterlacing mode is used. This means that we don't
need to track past references for basic bob or weave deinterlacing.
Gwenole Beauchesne [Fri, 22 Nov 2013 09:04:45 +0000 (10:04 +0100)]
vaapipostproc: fix "mixed" mode deinterlacing.
In "mixed" interlaced streams, the buffer contains additional flags that
specify whether the frame contained herein is interlaced or not. This means
that we can alternatively get progressive or interlaced frames. Make sure
to disable deinterlacing at the VPP level when the source buffer is no longer
interlaced.
Gwenole Beauchesne [Fri, 22 Nov 2013 08:49:30 +0000 (09:49 +0100)]
vaapipostproc: fix memory leaks with advanced deinterlacing.
Fix memory leaks with advanced deinterlacing, i.e. when we keep track
of past buffers. Completely reset the deinterlace state, thus destroying
any buffer currently held, on _start(), _stop() and _destroy().
Gwenole Beauchesne [Fri, 22 Nov 2013 05:59:51 +0000 (06:59 +0100)]
README: updates.
- GStreamer 1.2 APIs are supported ;
- Video Processing (VA/VPP) features.
Gwenole Beauchesne [Fri, 22 Nov 2013 05:45:22 +0000 (06:45 +0100)]
README: update for GStreamer >= 1.0.x and VPP features.
Gwenole Beauchesne [Fri, 22 Nov 2013 05:37:12 +0000 (06:37 +0100)]
legal: update copyright notice dates.
Gwenole Beauchesne [Fri, 22 Nov 2013 04:57:18 +0000 (05:57 +0100)]
legal: add per-file authorship information.
Credit original authors on a per-file basis as we cannot expect people
to know all country-specific rules, or bother browsing through the git
history.
Gwenole Beauchesne [Thu, 21 Nov 2013 22:52:43 +0000 (23:52 +0100)]
0.5.7.
Gwenole Beauchesne [Thu, 21 Nov 2013 22:51:59 +0000 (23:51 +0100)]
NEWS: updates.
Gwenole Beauchesne [Thu, 21 Nov 2013 22:17:59 +0000 (23:17 +0100)]
decoder: don't include obsolete headers.
The <gst/vaapi/gstvaapicontext.h> header was removed from the public
set of APIs. So, don't make public headers (gstvaapidecoder.h) depend
on private files.
Gwenole Beauchesne [Mon, 18 Nov 2013 15:20:43 +0000 (16:20 +0100)]
vaapipostproc: add initial support for GStreamer 1.2.
Port vaapipostproc element to GStreamer 1.2. Support is quite minimal
right now so that to cope with auto-plugging issues/regressions. e.g.
this happens when the correct set of expected caps are being exposed.
This means that, currently, the proposed caps are not fully accurate.
Halley Zhao [Fri, 1 Nov 2013 02:22:17 +0000 (10:22 +0800)]
vaapipostproc: add support for denoise and sharpen filters.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Thu, 21 Nov 2013 18:52:56 +0000 (19:52 +0100)]
vaapipostproc: add support for advanced deinterlacing.
Add initial support for advanced deinterlacing. The history buffer
size is arbitrarily set to 3 references for now.
Gwenole Beauchesne [Thu, 21 Nov 2013 21:32:03 +0000 (22:32 +0100)]
vaapipostproc: fix deinterlacing with VPP.
Fix basic deinterlacing flags provided to gst_vaapi_set_deinterlacing()
for the first field. Render flags were supplied instead of the actual
deinterlacing flags (deint_flags).
Gwenole Beauchesne [Thu, 21 Nov 2013 14:08:55 +0000 (15:08 +0100)]
vaapipostproc: fix transform caps.
Fix GstBaseTransform::transform_caps() implementation to always return
the complete set of allowed sink pad caps (unfixated) even if the src
pad caps we are getting are fixated. Rationale: there are just so many
possible combinations, and it was wrong to provide a unique set anyway.
As a side effect, this greatly simplifies the ability to derive src pad
caps from fixated sink pad caps.
Halley Zhao [Fri, 1 Nov 2013 02:31:13 +0000 (10:31 +0800)]
filter: add helper to specify references for deinterlacing.
Add gst_vaapi_fitler_set_deinterlacing_references() API to submit the
list of surfaces used for forward or backward reference in advanced
deinterlacing mode, e.g. Motion-Adaptive, Motion-Compensated.
The list of surfaces used as deinterlacing references shall be live
until the next call to gst_vaapi_filter_process().
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Thu, 21 Nov 2013 17:44:46 +0000 (18:44 +0100)]
filter: fix semantics of deinterlacing flags.
Fix deinterlacing flags to make more sense. The TFF (top-field-first)
flag is meant to specify the organization of reference frames used in
advanced deinterlacing modes. Introduce the more explicit flag TOPFIELD
to specify that the top-field of the supplied input surface is to be
used for deinterlacing. Conversely, if not set, this means that the
bottom field of the supplied input surface will be used instead.
Gwenole Beauchesne [Thu, 21 Nov 2013 16:20:28 +0000 (17:20 +0100)]
filter: add helpers to check for supported/active operation.
Add a couple of helper functions:
- gst_vaapi_filter_has_operation(): checks whether the VA driver
advertises support for the supplied operation ;
- gst_vaapi_filter_use_operation(): checks whether the supplied
operation was already enabled to its non-default value.
Gwenole Beauchesne [Wed, 20 Nov 2013 14:10:17 +0000 (15:10 +0100)]
libs: fix GstVaapiSurfaceProxy destroy notify call site.
The user-defined destroy notify function is meant to be called only when
the surface proxy was fully released, i.e. once it actually released the
VA surface back to the underlying pool.
XuGuangxin [Thu, 29 Aug 2013 05:44:22 +0000 (13:44 +0800)]
libs: make GstVaapiVideoPool thread-safe.
https://bugzilla.gnome.org/show_bug.cgi?id=707108
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
XuGuangxin [Thu, 29 Aug 2013 06:04:06 +0000 (14:04 +0800)]
libs: robustify decoder objects and surface proxy initialization.
Fix GstVaapiPicture, GstVaapiSlice and GstVaapiSurfaceProxy initialization
sequences to have the expected default values set beforehand in case of an
error raising up further during creation. i.e. make it possible to cleanly
destroy those partially initialized objects.
https://bugzilla.gnome.org/show_bug.cgi?id=707108
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Thu, 21 Nov 2013 10:01:41 +0000 (11:01 +0100)]
vaapidecode: fix decoder flush.
There are situations where gst_video_decoder_flush() is called, and
this subsequently produces a gst_video_decoder_reset() that kills the
currently active GstVideoCodecFrame. This means that it no longer
exists by the time we reach GstVideoDecoder::finish() callback, thus
possibly resulting in a crash if we assumed spare data was still
available for decode (current_frame_size > 0).
Try to honour GstVideoDecoder::reset() behaviour from GStreamer 1.0
that means a flush, thus performing the actual operations there like
calling gst_video_decoder_have_frame() if pending data is available.
Gwenole Beauchesne [Wed, 20 Nov 2013 18:21:05 +0000 (19:21 +0100)]
vaapidecode: fix dead-locks with decoder task.
Review all interactions between the main video decoder stream thread
and the decode task to derive a correct sequence of operations for
decoding. Also avoid extra atomic operations that become implicit under
the GstVideoDecoder stream lock.
XuGuangxin [Thu, 29 Aug 2013 06:12:10 +0000 (14:12 +0800)]
vaapidecode: fix hard reset for seek cases.
Fix hard reset for seek cases by flushing the GstVaapiDecoder queue
and completely purge any decoded output frame that may come out from
it. At this stage, the GstVaapiDecoder shall be in a complete clean
state to start decoding over new buffers.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
XuGuangxin [Thu, 29 Aug 2013 06:12:10 +0000 (14:12 +0800)]
vaapidecode: drop decode timeout, always wait for a free surface.
vaapidecode used to wait up to one second past the expected time of
presentation for the last decoded frame. This is not realistic in
practice when it comes to video pause/resume. Changed behaviour to
unconditionnally wait for a free VA surface prior to continuing the
decoding. The decode task will continue pushing the output frames to
the downstream element while also reporting errors at the same time
to the main thread.
https://bugzilla.gnome.org/show_bug.cgi?id=707108
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>