path: root/gst-libs
AgeCommit message (Collapse)AuthorFilesLines
2013-02-05mpeg2: fix decoding of 4K videos.Gwenole Beauchesne1-2/+2
Account for slice_vertical_position_extension when vertical_size > 2800.
2013-02-05legal: fix year for some copyright notices (2013).Gwenole Beauchesne4-4/+4
2013-02-05legal: fix year for some copyright notices (2012).Gwenole Beauchesne17-17/+17
2013-02-05legal: add Intel copyright on modified files.Gwenole Beauchesne19-0/+19
2013-01-28wayland: use a local event queue to avoid lock contention.Gwenole Beauchesne1-6/+20
2013-01-28wayland: fix thread-safe issues.Gwenole Beauchesne1-1/+9
The Wayland API is not fully thread-safe and client applications shall perform locking themselves on key functions. Besides, make sure to release the lock if the _render() function fails.
2013-01-28wayland: really wait until the pending redraw completed.Gwenole Beauchesne1-4/+24
Introduce gst_vaapi_window_wayland_sync() helper function to wait for the completion of the redraw request. Use it in _render() function to actually block until the previous draw request is completed.
2013-01-28wayland: fix frame_redraw callback.Gwenole Beauchesne1-5/+4
The redraw callback needs to be attached to the surface prior to the commit. Otherwise, the callback notifies the next surface repaint, which is not the desired behaviour. i.e. we want to be notified for the surface we have just filled. Another isse was the redraw_pending was reset before the actual completion of the frame redraw callback function, thus causing concurrency issues. e.g. the callback could have been called again, but with a NULL buffer.
2013-01-28wayland: fix display sharing.Gwenole Beauchesne1-6/+13
When the Wayland display is shared, we still have to create our own local shell and compositor objects, since they are not propagated from the cache. Likewise, we also need to determine the display size or vaapisink would fail to account for the display aspect ratio, and will try to create a 0x0 window.
2013-01-25h264: reset got_{sps,pps} when corrupted SPS/PPS headers are parsed.Zhao Halley1-2/+6
Reset got_{sps,pps} when corrupted SPS/PPS headers are parsed. This means that no frame will be decoded until valid SPS/PPS headers are parsed again. This also prevents from parsing slice headers with invalid data, and avoids potential crashes.
2013-01-25vc1: handle CLOSED_ENTRY.Gwenole Beauchesne1-1/+5
When CLOSED_ENTRY == 0, and if the B pictures that follow an entry-point lack a reference anchor picture, these B pictures shall be discarded.
2013-01-25vc1: fix decoding of WMV3 videos in AVI format.Wind Yuan1-0/+7
The AVI demuxer (avidemux) does not set a proper "format" attribute to the generated caps. So, try to recover the video codec format from the "wmvversion" property instead. Signed-off-by: Gwenole Beauchesne <>
2013-01-25vc1: review and report errors accordingly.Gwenole Beauchesne1-12/+12
Use GST_ERROR() to report real errors instead of hiding them into GST_DEBUG().
2013-01-25vc1: cope with latest codecparser changes.Gwenole Beauchesne1-6/+7
Fix build with newer VC-1 codecparser where dqsbedge was renamed to dqbedge, and now represents either DQSBEDGE or DQDBEDGE depending on the actual value of DQPROFILE.
2012-12-17image: fix GstVaapiImage map and unmap.Gwenole Beauchesne1-8/+7
Fix gst_vaapi_image_map() to return TRUE and the GstVaapiImageRaw structure correctly filled in if the image was already mapped. Likewise, make gst_vaapi_image_unmap() return TRUE if the image was already unmapped.
2012-12-17mpeg4: fix decoding at end-of-stream.Wind Yuan1-14/+34
Signed-off-by: Gwenole Beauchesne <>
2012-12-17mpeg4: fix size argument to gst_adapter_flush().Wind Yuan1-4/+4
Flush only consumed_size bytes from the GstAdapter. Signed-off-by: Gwenole Beauchesne <>
2012-12-17h264: initialize VA context before allocating the first slice.Gwenole Beauchesne1-5/+29
Fix decode_slice() to ensure a VA context exists prior to creating a new GstVaapiSliceH264, which invokes vaCreateBuffer() with some VA context ID. i.e. the latter was not initialized, thus causing failures on Cedar Trail for example.
2012-12-17libs: only export gst_vaapi_*() symbols.Gwenole Beauchesne1-0/+1
This fixes symbol clashes between the gst-vaapi built-in codecparsers/ library and the system-provided one, mainly used by videoparses/. Now, only symbols with the gst_vaapi_* prefix will be exported, if they are not marked as "hidden" to libgstvaapi.
2012-12-17libs: fix compatibility with glib 2.28.Gwenole Beauchesne1-24/+69
Always prefer non deprecated APIs by default and provide compatibility glue for older glib versions when necessary.
2012-12-17libs: use glib >= 2.32 semantics for mutexes.Gwenole Beauchesne4-23/+20
Use glib >= 2.32 semantics for GMutex and GRecMutex wrt. initialization and termination. Basically, the new mutex objects can be used as static mutex objects from the deprecated APIs, e.g. GStaticMutex and GStaticRecMutex.
2012-12-17videobuffer: fix memory leak for surface and image.Wind Yuan1-4/+2
Fix reference leak of surface and image in GstVaapiVideoBuffer wrapper, thus resulting on actual memory leak of GstVaapiImage when using them for downloads/uploads from VA surfaces and more specifically surfaces when the pipeline is shutdown. i.e. vaTerminate() was never called because the resources were not unreferenced, and thus not deallocated in the end. Signed-off-by: Gwenole Beauchesne <>
2012-11-19wayland: port to 1.0 version of the protocol.Rob Bradford3-24/+22
This patch updates to relect the 1.0 version of the protocol. The main changes are the switch to wl_registry for global object notifications and the way that the event queue and file descriptor is processed. Signed-off-by: Gwenole Beauchesne <>
2012-11-19h264: fix picture size in macroblocks.Gwenole Beauchesne1-12/+15
The picture size signalled by sps->{width,height} is the actual size with cropping applied, not the original size derived from pic_width_in_mbs_minus1 and pic_height_in_map_units_minus1. VA driver expects that original size, uncropped. There is another issue pending: frame cropping information needs to be taken care of.
2012-11-16h264: start decoding slices after first SPS/PPS activation.Gwenole Beauchesne1-0/+7
Only start decoding slices when at least one SPS and PPS got activated. This fixes cases when a source represents a substream of another stream and no SPS and PPS was inserted before the first slice of the generated substream.
2012-11-16h264: fix VAPictureParameterBufferH264.ReferenceFrames[] construction.Gwenole Beauchesne1-9/+16
... for interlaced streams. The short_ref[] and long_ref[] arrays may contain up to 32 fields but VA ReferenceFrames[] array expects up to 16 reference frames, thus including both fields.
2012-11-16h264: fix interlaced stream decoding with MMCO.Gwenole Beauchesne1-12/+20
Fix decoding of interlaced streams when adaptive_ref_pic_marking_mode_flag is equal to 1, i.e. when memory management control operations are used. In particular, when field_pic_flag is set to 0, the new reference flags shall be applied to both fields.
2012-11-16h264: add initial support for interlaced streams.Gwenole Beauchesne1-23/+232
Decoded frames are only output when they are complete, i.e. when both fields are decoded. This also means that the "interlaced" caps is not propagated to vaapipostproc or vaapisink elements. Another limitation is that interlaced bitstreams with MMCO are unlikely to work.
2012-11-16h264: split remove_reference_at() into finer units.Gwenole Beauchesne1-48/+80
Split remove_reference_at() into a function that actually removes the specified entry from the short-term or long-term reference picture array, and a function that sets reference flags to the desired value, possibly zero. The latters marks the picture as "unused for reference".
2012-11-16decoder: fix gst_vaapi_picture_new_field() object type.Gwenole Beauchesne1-1/+3
Fix gst_vaapi_picture_new_field() to preserve the original picture type. e.g. gst_vaapi_picture_new_field() with a GstVaapiPictureH264 argument shall generate a GstVaapiPictureH264 object.
2012-11-16h264: add picture structure for reference picture marking process.Gwenole Beauchesne1-13/+16
Introduce new `structure' field to the H.264 specific picture structure so that to simplify the reference picture marking process. That local picture structure is derived from the original picture structure, as defined by the syntax elements field_pic_flag and bottom_field_flag.
2012-11-16h264: introduce new frame store structure.Gwenole Beauchesne1-45/+215
The frame store represents a Decoded Picture Buffer entry, which can hold up to two fields. So far, the frame store is only used to hold full frames.
2012-11-16h264: minor clean-ups.Gwenole Beauchesne1-13/+5
Move DPB flush up if the current picture to decode is an IDR. Besides, don't bother to check for IDR pictures in dpb_add() function since an explicit DPB flush was already performed in this case.
2012-11-16h264: simplify reference picture marking process.Gwenole Beauchesne1-58/+55
... to build the short_ref[] and long_ref[] lists from the DPB, instead of maintaining them separately. This avoids refs/unrefs while making it possible to generate the list based on the actual picture structure. This also ensures that the list of generated ReferenceFrames[] actually matches what reference frames are available in the DPB. i.e. short_ref[] and long_ref[] entries are implied from the DPB, so there is no risk of having "dangling" references.
2012-11-16h264: introduce per-field POC in GstVaapiPictureH264.Gwenole Beauchesne1-38/+29
Use the POC member available in the GstVaapiPicture base class and get rid of the dependency on the local VAPictureH264 TopFieldOrderCnt and BottomFieldOrderCnt. Rather, use a simple field_poc[] array initialized to INT_MAX, so that to simplify picture POC calculation for non frame pictures.
2012-11-16h264: introduce GST_VAAPI_PICTURE_{SHORT,LONG}_TERM_REFERENCE flags.Gwenole Beauchesne1-44/+56
Further get rid of GstVaapiPictureH264-local VAPictureH264.flags for reference bits, thus simplifying the reference picture marking process to only track a single set of reference flags. Also introduce a new long_term_frame_idx member.
2012-11-16h264: introduce GST_VAAPI_PICTURE_FLAG_IDR flag.Gwenole Beauchesne1-13/+23
2012-11-16h264: fill in GstVaapiPicture structure.Gwenole Beauchesne1-57/+60
... and get rid of local VAPictureH264.flags fields in GstVaapiPictureH264.
2012-11-16h264: add vaapi_fill_picture() helper.Gwenole Beauchesne1-7/+44
Add vaapi_fill_picture() helper function to convert GstVaapiPictureH264 to VAPictureH264 structure. This is preparatory work to get rid of the local VAPictureH264 member in GstVaapiPictureH264.
2012-11-16h264: fix activation order of picture and sequence parameters.Gwenole Beauchesne1-128/+160
Delay ensure_context() until we actually need a VA context for allocating new VA surfaces, and then GstVaapiPictures, but also when a real activation of a new picture parameter set occurs, thus also implying an activation of the related sequence parameter set. The most important thing was to drop the global pps and sps pointers since they may not have matched the currently activated picture parameter or sequence parameter sets at the specified decode point. Anoter positive side-effect is that this cleans up all occurrences of decode_current_picture() to only keep those useful in decode_picture(), before a new picture is allocated, or in decode_sequence_end() when an end-of-stream or end-of-sequence condition occurred.
2012-11-16h264: fix detection of picture boundaries.Gwenole Beauchesne1-12/+92
Strictly follow the standard ( to detect the first VCL NAL unit of a primary coded picture.
2012-11-16h264: optimize handling of scaling lists.Gwenole Beauchesne1-39/+69
Don't copy scaling lists twice to an intermediate state. Rather, directly use the scaling lists from GstH264PPS since they would match those provided by SPS header, if necessary. i.e. if PPS-specific scaling lists are not available in the bitstream.
2012-11-16h264: simplify code when MMCO is 5.Gwenole Beauchesne1-71/+51
Remove exit_picture() and exit_picture_poc() since PicOrderCnt(CurrPic) is now updated accordingly to the standard. Besides, MMCO = 5 specific operations are moved up to exec_ref_pic_marking_adaptive_mmco_5().
2012-11-16h264: fix MMCO-based reference picture marking process.Gwenole Beauchesne1-21/+83
Fix adaptive memory control decoded reference picture marking process implementation for operations 2 to 6, thus also fixing support for long-term reference pictures.
2012-11-16h264: move MMCO handlers out of the loop (cosmetics).Gwenole Beauchesne1-50/+99
This change only splits each individual MMCO handler into several functions dedicated for each operation. This is needed to perform further work later on.
2012-11-16h264: add flag to compile with strict DPB ordering mode.Gwenole Beauchesne1-2/+9
Allow build with strict DPB ordering mode whereby evicted entries are replaced by the next entries, in order instead of optimizing it away with the last entry in the DPB. This is only useful for debugging purpose, against a reference SW decoder for example.
2012-11-16h264: drop extra code covered by built-in codecparsers.Gwenole Beauchesne1-25/+0
GstH264SliceHdr.n_emulation_prevention_bytes is bound to exist now that a newer version of codecparsers/ are used if the system provided one is now recent enough to have those required extensions.
2012-11-16h264: use pixel-aspect-ratio from SPS header.Simon Farnsworth1-0/+6
Propagate pixel-aspect-ratio determined by the GStreamer codecparser from the sequence headers. Signed-off-by: Simon Farnsworth <> Signed-off-by: Gwenole Beauchesne <>
2012-11-16h264: add decode_nalu() helper function.Gwenole Beauchesne1-36/+41
Split decode_buffer() into the core infrastructure that determines the NAL units contained in the adapter and the actual function that decodes the NAL unit.
2012-11-16h264: fix end-of-stream conditions (flush).Gwenole Beauchesne1-10/+22
Decode pending data in the adapter prior to processing the actual code for end-of-stream.