Gwenole Beauchesne [Tue, 15 Jan 2013 08:21:08 +0000 (09:21 +0100)]
0.5.0.
Gwenole Beauchesne [Mon, 14 Jan 2013 10:48:58 +0000 (11:48 +0100)]
docs: expose new interfaces.
Gwenole Beauchesne [Mon, 14 Jan 2013 11:58:20 +0000 (12:58 +0100)]
NEWS: updates.
Gwenole Beauchesne [Mon, 14 Jan 2013 09:58:49 +0000 (10:58 +0100)]
dpb: cosmetics (clean-ups).
Gwenole Beauchesne [Mon, 14 Jan 2013 09:46:25 +0000 (10:46 +0100)]
dpb: port to GstVaapiMiniObject.
Gwenole Beauchesne [Mon, 14 Jan 2013 09:21:53 +0000 (10:21 +0100)]
dpb: drop GstVaapiDpb2 interface, keep only one class.
Keep only one DPB interface and rename gst_vaapi_dpb2_get_references()
to gst_vaapi_dpb_get_neighbours() so that to retrieve pictures in DPB
around the specified picture POC.
Sreerenj Balachandran [Thu, 2 Aug 2012 12:56:54 +0000 (15:56 +0300)]
dpb: rename GstVaapiDpbMpeg2 to GstVaapiDpb2.
Move GstVaapiDpbMpeg2 API to a more generic version that could also be
useful to other decoders that require 2 reference pictures, e.g. VC-1.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Fri, 11 Jan 2013 15:04:30 +0000 (16:04 +0100)]
Bump version for pre-release.
Gwenole Beauchesne [Fri, 11 Jan 2013 14:57:09 +0000 (15:57 +0100)]
NEWS: updates.
Holger Kaelberer [Fri, 20 Jul 2012 10:36:33 +0000 (12:36 +0200)]
overlay: fix build without advanced GstVideoOverlayFormatFlags.
Check for global-alpha support in GstVideoOverlayComposition API.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Fri, 4 Jan 2013 09:19:56 +0000 (10:19 +0100)]
tests: add support for global-alpha subpictures.
Add --global-alpha option to test-subpicture.
Gwenole Beauchesne [Thu, 10 Jan 2013 12:09:28 +0000 (13:09 +0100)]
tests: use GstVideoOverlayComposition API for subpicture test.
Gwenole Beauchesne [Thu, 10 Jan 2013 10:26:17 +0000 (11:26 +0100)]
tests: use common decoder helpers for subpicture test.
Use common decoder helpers for subpicture test, thus allowing to decode
sample images in an alternate format.
Gwenole Beauchesne [Thu, 10 Jan 2013 10:22:38 +0000 (11:22 +0100)]
tests: add decoder helpers.
Gwenole Beauchesne [Fri, 11 Jan 2013 14:19:45 +0000 (15:19 +0100)]
overlay: fix ordering of composition layers.
Make sure to maintain the association order of composition layers when
GstVideoOverlayRectangle objects are kept around (cached).
Holger Kaelberer [Tue, 15 May 2012 08:24:08 +0000 (10:24 +0200)]
overlay: fix support for global-alpha.
Fix support for global-alpha subpictures. The previous changes brought
the ability to check for GstVideoOverlayRectangle changes by comparing
the underlying pixel buffer pointers. If sequence number and pixel data
did not change, then this is an indication that only the global-alpha
value changed. Now, try to update the underlying VA subpicture global-alpha
value.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Fri, 11 Jan 2013 10:53:05 +0000 (11:53 +0100)]
overlay: detect render-rect changes.
Don't re-upload VA subpicture if only the render rectangle changed.
Rather deassociate the subpicture and re-associate it with the new
render rectangle.
Gwenole Beauchesne [Fri, 11 Jan 2013 10:12:26 +0000 (11:12 +0100)]
overlay: fix check for pixels buffer change.
A GstVideoOverlayRectangle is created whenever the underlying pixels data
change. However, when global-alpha is supported, it is possible to re-use
the same GstVideoOverlayRectangle but with a change to the global-alpha
value. This process causes a change of sequence number, so we can no longer
check for that.
Still, if sequence numbers did not change, then there was no change in
global-alpha either. So, we need a way to compare the underlying GstBuffer
pointers. There is no API to retrieve the original pixels buffer from
a GstVideoOverlayRectangle. So, we use the following heuristics:
1. Use gst_video_overlay_rectangle_get_pixels_unscaled_argb() with the same
format flags from which the GstVideoOverlayRectangle was created. This
will work if there was no prior consumer of the GstVideoOverlayRectangle
with alternate (non-"native") format flags.
2. In overlay_rectangle_has_changed_pixels(), we have to use the same
gst_video_overlay_rectangle_get_pixels_unscaled_argb() function but
with flags that match the subpicture. This is needed to cope with
platforms that don't support global-alpha in HW, so the gst-video
layer takes care of that and fixes this up with a possibly new
GstBuffer, and hence pixels data (or) in-place by caching the current
global-alpha value applied. So we have to determine the rectangle
was previously used, based on what previous flags were used to
retrieve the ARGB pixels buffer.
Gwenole Beauchesne [Thu, 10 Jan 2013 17:42:37 +0000 (18:42 +0100)]
overlay: optimize cache at the GstVideoOverlayRectangle level.
We previously assumed that an overlay composition changed if the number
of overlay rectangles in there actually changed, or that the rectangle
was updated, and thus its seqnum was also updated.
Now, we can cope with cases where the GstVideoOverlayComposition grew
by one or a few more overlay rectangles, and the initial overlay rectangles
are kept as is.
Gwenole Beauchesne [Thu, 10 Jan 2013 12:41:39 +0000 (13:41 +0100)]
overlay: simplify caching of GstVideoOverlayComposition objects.
Create the GPtrArray once in the _init() function and destroy it only
in the _finalize() function. Then use overlay_clear() to remove all
subpicture associations for intermediate updates, don't recreate the
GPtrArray.
Make GstVaapiOverlayRectangle a reference counted object. Also make
sure that overlay_rectangle_new() actually creates and associates the
VA subpicture.
Holger Kaelberer [Tue, 15 May 2012 08:24:08 +0000 (10:24 +0200)]
overlay: add support for global-alpha.
Handle global-alpha from GstVideoOverlayComposition API. Likewise,
the same code path could also work for premultiplied-alpha but this
was not tested.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Holger Kaelberer [Tue, 15 May 2012 08:24:08 +0000 (10:24 +0200)]
subpicture: add support for global-alpha.
Add the necessary helpers in GstVaapiDisplay to determine whether subpictures
with global alpha are supported or not. Also add accessors in GstVaapiSubpicture
to address this feature.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Fri, 4 Jan 2013 08:41:25 +0000 (09:41 +0100)]
subpicture: add premultiplied-alpha and global-alpha feature flags.
Add premultiplied-alpha and global-alpha feature flags, along with converters
between VA-API and gstreamer-vaapi definitions. Another round of helpers is
also necessary for GstVideoOverlayComposition API.
Gwenole Beauchesne [Thu, 3 Jan 2013 17:02:49 +0000 (18:02 +0100)]
display: allow image/subpicture formats with additional flags.
Introduce new GstVaapiFormatInfo to store the actual GstVaapiImageFormat
and any additional flags needed. Currently, all flags are set to zero.
Gwenole Beauchesne [Fri, 11 Jan 2013 12:34:45 +0000 (13:34 +0100)]
libs: fix build of submodule wrappers.
Make sure to build codecparsers/ and videoutils/ sources against the
newly generated headers when out-of-source builds are used.
Gwenole Beauchesne [Fri, 11 Jan 2013 13:11:39 +0000 (14:11 +0100)]
configure: fix checks for packages installed in non-standard roots.
Gwenole Beauchesne [Thu, 10 Jan 2013 09:12:25 +0000 (10:12 +0100)]
decoder: fix mini object implementation on 64-bit systems.
Use GPOINTER_TO_SIZE() instead of GPOINTER_TO_UINT() while manipulating
pointers. The latter is meant to be 32-bit only, not uintptr_t like size.
Only a gsize can hold all bits of a pointer.
Thanks to Ouping Zhang for spotting this error.
Gwenole Beauchesne [Wed, 9 Jan 2013 15:05:39 +0000 (16:05 +0100)]
mpeg2: optimize scan for the end of the frame.
Heuristic: if the second start-code is available, check whether that
one marks the start of a new frame because e.g. this is a sequence
or picture header. This doesn't save much, since we already cache the
results.
Gwenole Beauchesne [Wed, 9 Jan 2013 12:44:18 +0000 (13:44 +0100)]
mpeg2: optimize scan for start codes.
Accelerate scan for start codes by skipping up to 3 bytes per iteration.
A start code prefix is defined by the following bytes: 00 00 01. Thus,
for any group of 3 bytes (xx yy zz), we have the following possible cases:
1. If zz != 1, this cannot be a start code, then skip 3 bytes;
2. If yy != 0, this cannot be a start code, then skip 2 bytes;
3. If xx != 0 or zz != 1, this cannot be a start code, then skip 1 byte;
4. xx == 00, yy == 00, zz == 1, we have match!
This algorithm requires to peek bytes from the adapter. This increases the
amount of bytes copied to a temporary buffer, but this process is much faster
than scanning for all the bytes and using shift/masks. So, overall, this is
a win.
Gwenole Beauchesne [Tue, 8 Jan 2013 15:41:44 +0000 (16:41 +0100)]
mpeg2: drop useless gst_adapter_peek().
Drop useless gst_adapter_peek() since the returned buffer was not used
and this could incur superfluous memcpy().
Gwenole Beauchesne [Mon, 7 Jan 2013 15:07:38 +0000 (16:07 +0100)]
mpeg2: cosmetics: move parse_slice() down.
Gwenole Beauchesne [Mon, 7 Jan 2013 14:24:51 +0000 (15:24 +0100)]
mpeg2: avoid too many allocations of parser info objects.
Move parsing back to decoding step, but keep functions separate for now.
This is needed for future optimizations that may introduce some meta data
for parsed info attached to codec frames.
Gwenole Beauchesne [Mon, 7 Jan 2013 13:04:22 +0000 (14:04 +0100)]
decoder: decoder units are no longer dynamically allocated objects.
Gwenole Beauchesne [Mon, 7 Jan 2013 12:59:07 +0000 (13:59 +0100)]
decoder: optimize pre-allocation of decoder units.
Optimize pre-allocation of decoder units, thus avoiding un-necessary
memory reallocations. The heuristic used is that we could have around
one slice unit per macroblock line.
Gwenole Beauchesne [Mon, 7 Jan 2013 12:41:59 +0000 (13:41 +0100)]
decoder: use an array of units instead of a single-linked list.
Use a GArray to hold decoder units in a frame, instead of a single-linked
list. This makes 'append' calls faster, but not that much. At least, this
makes things clearer.
Gwenole Beauchesne [Mon, 7 Jan 2013 10:13:07 +0000 (11:13 +0100)]
decoder: refactor decoder unit API.
Allocate decoder unit earlier in the main parse() function and don't
delegate this task to derived classes. The ultimate purpose is to get
rid of dynamic allocation of decoder units.
Gwenole Beauchesne [Mon, 7 Jan 2013 09:48:27 +0000 (10:48 +0100)]
mpeg2: introduce parser info instead of MPEG-2 specific decoder unit.
Use a new GstVaapiParserInfoMpeg2 data structure instead of deriving
from GstVaapiDecoderUnit for MPEG-2 specific parser information.
Gwenole Beauchesne [Mon, 7 Jan 2013 09:22:54 +0000 (10:22 +0100)]
h264: introduce parser info instead of H.264 specific decoder unit.
Use a new GstVaapiParserInfoH264 data structure instead of deriving
from GstVaapiDecoderUnit for H.264 specific parser information.
Sreerenj Balachandran [Sat, 5 Jan 2013 10:33:06 +0000 (12:33 +0200)]
h264: set default values for some header fields.
The SPS, PPS and slice headers are not fully zero-initialized in the
codecparsers/ library. Rather, the standard upstream behaviour is to
initialize only certain syntax elements with some inferred values if
they are not present in the bitstream.
At the gstreamer-vaapi decoder level, we need to further initialize
certain syntax elements with some sensible default values so that to
not complicate VA drivers that just pass those verbatim to the HW,
and also avoid an memset() of the whole decoder unit.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Sun, 6 Jan 2013 18:05:49 +0000 (19:05 +0100)]
codecparsers: update to gst-vaapi-rebased commit b47983a.
b47983a h264: add inferred value for slice_beta_offset_div2
Gwenole Beauchesne [Sat, 5 Jan 2013 16:55:47 +0000 (17:55 +0100)]
plugins: cope with new GstVaapiVideoMeta API.
Update plugin elements with the new GstVaapiVideoMeta API.
This also fixes support for subpictures/overlay because GstVideoDecoder
generates a sub-buffer from the GstVaapiVideoBuffer. So, that sub-buffer
is marked as read-only. However, when comes in the textoverlay element
for example, it checks whether the input buffer is writable. Since that
buffer read-only, then a new GstBuffer is created. Since gst_buffer_copy()
does not preserve the parent field, the generated buffer in textoverlay
is not exploitable because we lost all VA specific information.
Now, with GstVaapiVideoMeta information attached to a standard GstBuffer,
all information are preserved through gst_buffer_copy() since the latter
does copy metadata (qdata in this case).
Gwenole Beauchesne [Sat, 5 Jan 2013 16:37:13 +0000 (17:37 +0100)]
videobuffer: wrap video meta into a surface buffer.
Make GstVaapiVideoBuffer a simple wrapper for video meta. This buffer is
no longer necessary but for compatibility with GStreamer 0.10 APIs or users
expecting a GstSurfaceBuffer like Clutter.
Gwenole Beauchesne [Sat, 5 Jan 2013 07:31:24 +0000 (08:31 +0100)]
videobuffer: add video meta information.
Add new GstVaapiVideoMeta object that holds all information needed to
convey gst-vaapi specific data as a GstBuffer.
Gwenole Beauchesne [Thu, 3 Jan 2013 12:10:33 +0000 (13:10 +0100)]
vaapidecode: fix calculation of the time-out value.
Fix calculation of the time-out value for cases where no VA surface is
available for decoding. In this case, we need to wait until downstream
sink consumed at least one surface. The time-out was miscalculated as
it was always set to <current-time> + one second, which is not suitable
for streams with larger gaps.
Gwenole Beauchesne [Thu, 3 Jan 2013 12:05:47 +0000 (13:05 +0100)]
decoder: always use the calculated presentation timestamp.
Use PTS value computed by the decoder, which could also be derived from
the GstVideoCodecFrame PTS. This makes it possible to fix up the PTS if
the original one was miscomputed or only represented a DTS instead.
Gwenole Beauchesne [Wed, 2 Jan 2013 16:33:15 +0000 (17:33 +0100)]
h264: don't create sub-buffer for slice data.
Gwenole Beauchesne [Thu, 3 Jan 2013 10:16:44 +0000 (11:16 +0100)]
decoder: create new context when encoded resolution changes.
Create a new VA context if the encoded surface size changes because we
need to keep the underlying surface pool until the last one was released.
Otherwise, either of the following cases could have happened: (i) release
a VA surface to an inexistent pool, or (ii) release VA surface to an
existing surface pool, but with different size.
Gwenole Beauchesne [Wed, 2 Jan 2013 16:23:53 +0000 (17:23 +0100)]
mpeg2: don't create sub-buffer for slice data.
Avoid creating a GstBuffer for slice data. Rather, directly use the codec
frame input buffer data. This is possible because the codec frame is valid
until end_frame() where we submit the VA buffers for decoding. Anyway, the
slice data buffer is copied into the VA buffer when it is created.
Gwenole Beauchesne [Wed, 2 Jan 2013 13:45:50 +0000 (14:45 +0100)]
mpeg2: minor clean-ups.
Drop explicit initialization of most fields that are implicitly set to
zero. Remove some useless checks for NULL pointers.
Gwenole Beauchesne [Wed, 2 Jan 2013 13:18:31 +0000 (14:18 +0100)]
mpeg2: optimize scan for the second start code.
Optimize scan for the second start code, on the next parse() call so that
to avoid scanning again earlier bytes where we didn't find any start code.
Gwenole Beauchesne [Wed, 2 Jan 2013 13:10:20 +0000 (14:10 +0100)]
mpeg2: use sequence_display_extension() to compute PAR.
Also compute pixel-aspect-ratio from sequence_display_extension(),
should it exist in the bitstream.
Gwenole Beauchesne [Wed, 2 Jan 2013 13:02:29 +0000 (14:02 +0100)]
mpeg2: handle sequence_display_extension().
Gwenole Beauchesne [Thu, 27 Dec 2012 14:18:55 +0000 (15:18 +0100)]
mpeg2: implement {start,end}_frame() hooks.
Implement GstVaapiDecoder.start_frame() and end_frame() semantics so
that to create new VA context earlier and submit VA pictures to the
HW for decoding as soon as possible. i.e. don't wait for the next
frame to start decoding the previous one.
Gwenole Beauchesne [Thu, 27 Dec 2012 13:54:29 +0000 (14:54 +0100)]
mpeg2: parse slice() header earlier.
Parse slice() header and first macroblock position earlier in _parse()
function instead of waiting for the _decode() stage. This doesn't change
anything but readability.
Gwenole Beauchesne [Thu, 27 Dec 2012 13:41:04 +0000 (14:41 +0100)]
mpeg2: add codec specific decoder unit.
Introduce new GstVaapiDecoderUnitMpeg2 object, which holds the standard
GstMpegVideoPacket and additional parsed header info. Besides, we now
parse as early as in the _parse() function so that to avoid un-necessary
creation of sub-buffers in _decode() for video packets that are not slices.
Gwenole Beauchesne [Thu, 27 Dec 2012 17:52:43 +0000 (18:52 +0100)]
decoder: introduce lists of units to decode before/after frame.
Theory of operations: all units marked as "slice" are moved to the "units"
list. Since this list only contains slice data units, the prev_slice pointer
was removed. Besides, we now maintain two extra lists of units to be decoded
before or after slice data units.
In particular, all units in the "pre_units" list will be decoded before
GstVaapiDecoder::start_frame() is called and units in the "post_units"
list will be decoded after GstVaapiDecoder::end_frame() is called.
Gwenole Beauchesne [Wed, 2 Jan 2013 15:06:18 +0000 (16:06 +0100)]
decoder: drop useless checks for codec objects.
Codec objects are used internally only and they are bound to be created
with a valid GstVaapiDecoder object.
Gwenole Beauchesne [Thu, 27 Dec 2012 09:35:45 +0000 (10:35 +0100)]
vaapidecode: use GST_ERROR to print error messages.
Gwenole Beauchesne [Thu, 27 Dec 2012 08:55:14 +0000 (09:55 +0100)]
vaapidecode: avoid double release of frame on error.
Don't call gst_video_decoder_drop_frame() if gst_video_decoder_finish_frame()
was already called before and it returned an error. In that case, we were
releasing the frame again, thus leading to a "double-free" condition.
Gwenole Beauchesne [Fri, 21 Dec 2012 13:29:01 +0000 (14:29 +0100)]
Add videoutils submodule for GstVideoDecoder APIs.
Gwenole Beauchesne [Tue, 18 Dec 2012 15:36:01 +0000 (16:36 +0100)]
configure: check for GstVideoDecoder API.
GstVideoDecoder API is part of an unreleased GStreamer 0.10 stack. In particular,
this is only available in git 0.10 branch or GStreamer >= 1.0 stack. Interested
parties may either use upstream git 0.10 branch or backport the necessary support
for GstVideoDecoder API, thus including helper tools like GstVideoCodecFrame et al.
Gwenole Beauchesne [Tue, 18 Dec 2012 15:21:31 +0000 (16:21 +0100)]
docs: remove obsolete gst_vaapi_surface_proxy_get_type().
GstVaapiSurfaceProxy is no longer based on the GType system.
Gwenole Beauchesne [Tue, 18 Dec 2012 15:17:22 +0000 (16:17 +0100)]
docs: fix entries for GstVaapiSurfaceProxy.
Gwenole Beauchesne [Tue, 18 Dec 2012 14:29:58 +0000 (15:29 +0100)]
NEWS: updates.
Gwenole Beauchesne [Tue, 18 Dec 2012 14:15:52 +0000 (15:15 +0100)]
Bump library major version.
Increase library major so that to cope with API/ABI incompatible changes
since 0.4.x series and avoid user issues.
Gwenole Beauchesne [Thu, 13 Dec 2012 15:02:52 +0000 (16:02 +0100)]
surfaceproxy: minor clean-ups.
Gwenole Beauchesne [Thu, 13 Dec 2012 14:51:24 +0000 (15:51 +0100)]
surfaceproxy: drop accessors to obsolete attributes.
Make GstVaapiSurfaceProxy only a thin wrapper around a VA context and a
VA surface. i.e. drop any other attribute like timestamp, duration,
interlaced or top-field-first.
Gwenole Beauchesne [Thu, 13 Dec 2012 14:34:10 +0000 (15:34 +0100)]
decoder: maintain decoded frames as GstVideoCodecFrame objects.
Maintain decoded surfaces as GstVideoCodecFrame objects instead of
GstVaapiSurfaceProxy objects. The latter will tend to be reduced to
the strict minimum: a context and a surface.
Gwenole Beauchesne [Thu, 13 Dec 2012 13:30:18 +0000 (14:30 +0100)]
vaapidecode: output all decoded frames as soon as possible.
Make sure to push all decoded frames downstream as soon as possible.
This makes sure we don't need to wait for a new frame to be ready to
be decoded before receiving new decoded frames.
This also separates the decode process and the output process. The latter
could be moved to a specific GstTask later on.
Gwenole Beauchesne [Thu, 13 Dec 2012 13:27:18 +0000 (14:27 +0100)]
decoder: add gst_vaapi_decoder_get_frame() API.
Add new gst_vaapi_decoder_get_frame() function meant to be used with
gst_vaapi_decoder_decode(). The purpose is to return the next decoded
frame as a GstVideoCodecFrame and the associated GstVaapiSurfaceProxy
as the user-data object.
Gwenole Beauchesne [Thu, 13 Dec 2012 14:47:27 +0000 (15:47 +0100)]
vaapipostproc: use GstBuffer flags for TFF.
Determine whether the buffer represents the top-field only by checking for
the GST_VIDEO_BUFFER_TFF flag instead of relying on the GstVaapiSurfaceProxy
flag. Also trust "interlaced" caps to determine whether the input frame
is interleaved or not.
Gwenole Beauchesne [Thu, 13 Dec 2012 12:27:33 +0000 (13:27 +0100)]
vaapipostproc: handle video sub-buffers.
Intermediate elements may produce a sub-buffer from a valid GstVaapiVideoBuffer
for non raw YUV cases. Make sure vaapipostproc now understands those buffers.
Gwenole Beauchesne [Tue, 18 Dec 2012 13:57:36 +0000 (14:57 +0100)]
h264: optimize initialization process of decoder units.
Decoder units were zero-initialized, including the SPS/PPS/slice headers.
The latter don't require zero-initialization since the codecparsers/ lib
will do so for key variables already. This is not a great value per se but
at least it makes it possible to check whether the default initialization
decisions made in the codecparsers/ lib were right or not.
This can be reverted if this exposes too many issues.
Gwenole Beauchesne [Thu, 13 Dec 2012 10:48:06 +0000 (11:48 +0100)]
h264: minor clean-ups.
Drop explicit initialization of most fields that are implicitly set to
zero. Drop helper macros for casting to GstVaapiPictureH264 or
GstVaapiFrameStore. Also remove some useless checks for NULL pointers.
Gwenole Beauchesne [Fri, 7 Dec 2012 16:45:03 +0000 (17:45 +0100)]
h264: drop GstVaapiSliceH264 object.
Use standard GstVaapiSlice object from now on since we already have
parsed and recorded the slice headers (GstH264SliceHdr decode units).
Gwenole Beauchesne [Thu, 13 Dec 2012 09:47:25 +0000 (10:47 +0100)]
h264: detect new pictures from decode-units.
Update is_new_picture() to cope with GstVaapiDecoderUnitH264, instead
of assuming frame boundaries when first_mb_in_slice is zero.
Gwenole Beauchesne [Thu, 13 Dec 2012 09:21:46 +0000 (10:21 +0100)]
h264: implement {start,end}_frame() hooks.
Implement GstVaapiDecoder.start_frame() and end_frame() semantics so
that to create new VA context earlier and submit VA pictures to the
HW for decoding as soon as possible. i.e. don't wait for the next
frame to start decoding the previous one.
Gwenole Beauchesne [Wed, 12 Dec 2012 17:33:52 +0000 (18:33 +0100)]
h264: optimize scan for the second start code.
Optimize scan for the second start code, on the next parse() call so that
to avoid scanning again earlier bytes where we didn't find any start code.
Gwenole Beauchesne [Thu, 6 Dec 2012 16:25:01 +0000 (17:25 +0100)]
h264: add codec specific decoder unit.
Introduce new GstVaapiDecoderUnitH264 object, which holds the standard
NAL unit header (GstH264NalUnit) and additional parsed header info.
Besides, we now parse headers as early as in the _parse() function so
that to avoid un-necessary creation of sub-buffers in _decode() for
NAL units that are not slices.
This is a performance win by ~+1.1% only.
Gwenole Beauchesne [Tue, 4 Dec 2012 10:01:42 +0000 (11:01 +0100)]
vaapisink: handle sub video-buffers.
Intermediate elements may produce a sub-buffer from a valid GstVaapiVideoBuffer
for non raw YUV cases. Make sure vaapisink now understands those buffers.
Sreerenj Balachandran [Wed, 12 Dec 2012 14:22:32 +0000 (15:22 +0100)]
vaapidecode: use gst_vaapi_decoder_get_codec_state().
Directly use the GstVideoCodecState associated with the VA decoder
instead of parsing caps again.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Tue, 4 Dec 2012 13:53:15 +0000 (14:53 +0100)]
vaapidecode: use more standard helpers.
Use g_clear_object() [glib >= 2.28] and gst_caps_replace() helper functions
in more places.
Sreerenj Balachandran [Tue, 4 Dec 2012 13:45:29 +0000 (14:45 +0100)]
vaapidecode: move to GstVideoDecoder base class.
Make vaapidecode derive from the standard GstVideoDecoder base element
class. This simplifies the code to the strict minimum for the decoder
element and makes it easier to port to GStreamer 1.x API.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Thu, 6 Dec 2012 13:02:25 +0000 (14:02 +0100)]
jpeg: initial port to new GstVaapiDecoder API
Gwenole Beauchesne [Thu, 6 Dec 2012 13:02:21 +0000 (14:02 +0100)]
vc1: initial port to new GstVaapiDecoder API
Gwenole Beauchesne [Thu, 6 Dec 2012 13:02:17 +0000 (14:02 +0100)]
h264: initial port to new GstVaapiDecoder API
Gwenole Beauchesne [Mon, 17 Dec 2012 17:47:20 +0000 (09:47 -0800)]
mpeg4: initial port to new GstVaapiDecoder API
Gwenole Beauchesne [Thu, 6 Dec 2012 13:01:46 +0000 (14:01 +0100)]
mpeg2: initial port to new GstVaapiDecoder API.
Sreerenj Balachandran [Wed, 12 Dec 2012 14:09:21 +0000 (15:09 +0100)]
decoder: use GstVideoCodecState.
Use standard GstVideoCodecState throughout GstVaapiDecoder and expose
it with a new gst_vaapi_decoder_get_codec_state() function. This makes
it possible to drop picture size (width, height) information, framerate
(fps_n, fps_d) information, pixel aspect ratio (par_n, par_d) information,
and interlace mode (is_interlaced field).
This is a new API with backwards compatibility maintained. In particular,
gst_vaapi_decoder_get_caps() is still available.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Gwenole Beauchesne [Wed, 12 Dec 2012 12:44:07 +0000 (13:44 +0100)]
decoder: update gst_vaapi_decoder_get_surface() semantics.
Align gst_vaapi_decoder_get_surface() semantics with the rest of the
API. That is, return a GstVaapiDecoderStatus and the decoded surface
as a handle to GstVaapiSurfaceProxy in parameter.
This is an API/ABI change.
Gwenole Beauchesne [Fri, 7 Dec 2012 15:40:44 +0000 (16:40 +0100)]
decoder: use standard helper functions.
Use g_clear_object(), gst_buffer_replace() and gst_caps_replace()
whenever necessary.
Gwenole Beauchesne [Thu, 29 Nov 2012 14:06:00 +0000 (15:06 +0100)]
decoder: expose new parse/decode API.
Introduce new decoding process whereby a GstVideoCodecFrame is created
first. Next, input stream buffers are accumulated into a GstAdapter,
that is then passed to the _parse() function. The GstVaapiDecoder object
accumulates all parsed units and when a complete frame or field is
detected, that GstVideoCodecFrame is passed to the _decode() function.
Ultimately, the caller receives a GstVaapiSurfaceProxy if decoding
process was successful.
Gwenole Beauchesne [Thu, 13 Dec 2012 09:20:35 +0000 (10:20 +0100)]
decoder: add {start,end}_frame() hooks.
The start_frame() hook is called prior to traversing all decode-units
for decoding. The unit argument represents the first slice in the frame.
Some codecs (e.g. H.264) need to wait for the first slice in order to
determine the actual VA context parameters.
Gwenole Beauchesne [Thu, 6 Dec 2012 12:57:42 +0000 (13:57 +0100)]
decoder: add new GstVaapiDecoder API.
Split decoding process into two steps: (i) parse incoming bitstreams
into simple decoder-units until the frame or field is complete; and
(ii) decode the whole frame or field at once.
This is an ABI change.
Gwenole Beauchesne [Wed, 5 Dec 2012 09:51:41 +0000 (10:51 +0100)]
decoder: add new "decoder-frame" object.
Introduce a new GstVaapiDecoderFrame that is just a list of decoder units
(GstVaapiDecoderUnit objects) that constitute a frame. This object is just
an extension to GstVideoCodecFrame for VA decoder purposes. It is available
as the user-data member element.
This is a libgstvaapi internal object.
Gwenole Beauchesne [Thu, 6 Dec 2012 08:44:01 +0000 (09:44 +0100)]
decoder: add new "decoder-unit" object.
Introduce GstVaapiDecoderUnit which represents a fragment of the source
stream to be decoded. For instance, a decode-unit will be a NAL unit for
H.264 streams, an EBDU for VC-1 streams, and a video packet for MPEG-2
streams.
This is a libgstvaapi internal object.
Gwenole Beauchesne [Mon, 3 Dec 2012 13:09:01 +0000 (14:09 +0100)]
Port GstVaapiFrameStore to GstVaapiMiniObject.
Gwenole Beauchesne [Mon, 3 Dec 2012 10:19:08 +0000 (11:19 +0100)]
Port codec objects to GstVaapiMiniObject.
Gwenole Beauchesne [Mon, 3 Dec 2012 12:46:28 +0000 (13:46 +0100)]
surfaceproxy: port to GstVaapiMiniObject.
GstVaapiSurfaceProxy does not use any particular functionality from
GObject. Actually, it only needs a basic object type with reference
counting.
This is an API and ABI change.
Gwenole Beauchesne [Fri, 30 Nov 2012 16:25:07 +0000 (17:25 +0100)]
Add GstVaapiMiniObject.
Introduce a new reference counted object that is very lightweight and
also provides flags and user-data functionalities. Initialization and
finalization times are reduced by up to a factor 5x vs GstMiniObject
from GStreamer 0.10 stack.
This is a libgstvaapi internal object.