summaryrefslogtreecommitdiff
path: root/gst-libs
Commit message (Collapse)AuthorAgeFilesLines
* codecs: av1decoder: Use GstFlowReturn everywhereSeungha Yang2021-09-202-57/+78
| | | | | | The same modification as that of VP8 decoder Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2528>
* codecs: vp9decoder: Use GstFlowReturn everywhereSeungha Yang2021-09-202-21/+37
| | | | | | The same modification as that of VP8 decoder Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2528>
* codecs: vp8decoder: Use GstFlowReturn everywhereSeungha Yang2021-09-202-31/+71
| | | | | | | | | | boolean return value is not sufficient for representing the reason of error in most cases. For instance, any errors around new_sequence() would mean negotiation error, not just *ERROR*. And some subclasses will allocate buffer/memory/surface on new_picture() but it could be failed because of expected error, likely flushing Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2528>
* player: Fix/add various annotationsSebastian Dröge2021-09-204-70/+83
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2538>
* player: Add missing nullable annotationsMarijn Suijten2021-09-192-11/+12
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2197>
* play: Add missing nullable annotationsMarijn Suijten2021-09-192-7/+8
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2197>
* codecs: mpeg2decoder: Use tsg framerate for latency.Víctor Manuel Jáquez Leal2021-09-171-10/+16
| | | | | | | | | | Latency setting relies on src pad caps, but they aren't set when the function is called, and latency is never updated. In order to fix it, this patch uses TSG framerate first, and if it's not set yet, sinkpad caps are used to get the framerate. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2514>
* codecs: h264dec: Check bumping again after inserting current picture.He Junyan2021-09-151-27/+28
| | | | | | | | | | In order to get the lowest latency, we can add another bumping check after inserting the current picture into the DPB immediately. That can avoid waiting for another decoding circle of the next frame and so the latency is lower. Fix: #1628 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2501>
* codecs: h264: Add protection to to_insert picture in bump check.He Junyan2021-09-151-5/+6
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2501>
* codecs: h264dec: Improve the policy to infer max_num_reorder_frames.He Junyan2021-09-151-3/+13
| | | | | | | | | | | | | | The max_num_reorder_frames number can change the way we bumping the pictures in the DPB. The smaller it is, the lower latency we will get. So it is important for live mode streams, but it is not given in VUI parameters sometimes. We now improve the policy to infer it: 1. Never guess it in the "strict" compliance. 2. For baseline and constrained baseline profiles, which do not have B frames, set it to 0. 3. For -intra only profiles, set it to 0. 4. Otherwise, not guess it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2501>
* codecs: h264dec: Improve the fast bump for the live mode.He Junyan2021-09-131-2/+39
| | | | | | | | | We control the policy of fast bump by the profile and the compliance property. For baseline and constrained baseline profiles, we can use more radical bump policy. User can also change the bump policy by setting the compliance property in run time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2432>
* codecs: h264: Change the low_latency to an enum for dpb_needs_bump().He Junyan2021-09-132-19/+34
| | | | | | | | The bool parameter of low_latency is not enough. We have multi policies for low latency bumping, from the safest to something radical. So we need an enum to represent the proper latency requirement. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2432>
* codecs: h264dec: Add a compliance property to control behavior.He Junyan2021-09-132-0/+142
| | | | | | | | | | Some features such as the low-latency DPB bumping and mapping the baseline profile as the constrained-baseline profile do not conform to the H264 offical spec. But in practice, they are very useful and are widely needed. We add this compliance property to control the behavior of the decoder, make it fit more requirement. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2432>
* codecs: gstvp9statefulparser: feature_data should be 0 if feature_enable is 0Daniel Almeida2021-09-091-2/+10
| | | | | | | | The spec says in 6.2.11 that feature_data[i][j] should be zero if feature_enabled[i][j] is zero. Instead we retained the old value in the parser. Fix it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2449>
* gsth264parser: Fix handling of NALs with emulation byte setMarek Vasut2021-09-091-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case a set of NALs with emulation_prevention_three_byte is decoded using hardware decoder like Hantro G1, wrong struct v4l2_ctrl_h264_decode_params .dec_ref_pic_marking_bit_size is passed into the kernel, which results in decoding artifacts. Subtract the number of emulation three bytes from the .dec_ref_pic_m->bit_size to get the correct bit size and avoid having these artifacts. Apply the exact same fix to slice->pic_order_cnt_bit_size as well. The following NALs (7, 8, 6, 5) decode with artifacts, .dec_ref_pic_marking_bit_size is set to 10 without this patch. 00000000 00 00 00 01 27 4d 00 20 89 8b 60 3c 04 bf 2e 02 |....'M. ..`<....| 00000010 d4 18 04 18 c0 c0 01 77 00 00 5d c1 7b df 05 00 |.......w..].{...| 00000020 00 00 01 28 ee 1f 20 00 00 01 06 05 10 b9 ed b9 |...(.. .........| 00000030 30 5d 21 4b 71 83 71 2c 10 a3 14 bb 29 80 00 00 |0]!Kq.q,....)...| 00000040 01 25 b8 00 05 00 00 03 03 7f fa 78 1e e7 fd fe |.%.........x....| ^^^^^^^^^^^^--- emulation 3 byte 00000050 b4 62 7a 31 ff 7d 81 fd 26 d8 62 b6 d6 25 46 ae |.bz1.}..&.b..%F.| The following NALs (7, 8, 6, 5) decode fine, .dec_ref_pic_marking_bit_size is set to 2 without this patch. 00000000 00 00 00 01 27 4d 00 20 89 8b 60 3c 04 bf 2e 02 |....'M. ..`<....| 00000010 d4 18 04 18 c0 c0 01 77 00 00 5d c1 7b df 05 00 |.......w..].{...| 00000020 00 00 01 28 ee 1f 20 00 00 01 06 05 10 b9 ed b9 |...(.. .........| 00000030 30 5d 21 4b 71 83 71 2c 10 a3 14 bb 29 80 00 00 |0]!Kq.q,....)...| 00000040 01 25 b8 00 04 c0 00 03 7f fa 78 1e e7 fd fe b4 |.%........x.....| 00000050 62 7a 31 ff 7d 81 fd 26 d8 62 b6 d6 25 46 ae ce |bz1.}..&.b..%F..| Fixes: d0d65fa875 ("codecparsers: h264: record dec_ref_pic_marking() size") Fixes: 0cc7d6f093 ("codecparsers: h264: record pic_order_cnt elements size") Signed-off-by: Marek Vasut <marex@denx.de> Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2517>
* gsth264parser: reject memory management control op greater than 6Aaron Boxer2021-09-091-1/+1
| | | | | | | | This prevents assertion from being thrown in gst_h264_dpb_perform_memory_management_control_operation if corrupt NAL has a control op greater than 6 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2508>
* vulkan: don't link to XOpenDisplay in documentationMathieu Duponchelle2021-09-081-1/+1
| | | | | | hotdoc doesn't know about that symbol Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2518>
* codecs: av1dec: Fix to output frame with highest spatial layerMengkejiergeli Ba2021-08-271-3/+25
| | | | | | | | | During the output process, if there are multiple frames in a TU (i.e. multi-spatial layers case), only one frame with the highest spatial layer id should be selected according to av1 spec. The highest spatial layer id is obtained from idc value of the operating point. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2475>
* gsth264parser: fix typo in debug messageBrad Hards2021-08-271-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2493>
* webrtc: Split sctptransport into lib and implementation partsJohan Sternerup2021-08-255-0/+147
| | | | | | | | | | | | | | | GstWebRTCSCTPTransport is now made into into an abstract base class that only contains property specifications matching the RTCSctpTransport interface of the W3C WebRTC specification, see https://w3c.github.io/webrtc-pc/#rtcsctptransport-interface. This class is put into the WebRTC library to expose it for applications and to allow for generation of bindings for non-dynamic languages using GObject introspection. The actual implementation is moved to the subclass WebRTCSCTPTransport located in the WebRTC plugin. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2214>
* d3d11bufferpool: Hide buffer_size field from headerSeungha Yang2021-08-222-6/+1
| | | | | | | | | | | | | | User can get the required buffer size by using buffer pool config. Since d3d11 implementation is a candidate for public library in the future, we need to hide everything from header as much as possible. Note that the total size of allocated d3d11 texture memory by GPU is not controllable factor. It depends on hardware specific alignment/padding requirement. So, GstD3D11 implementation updates actual buffer size by allocating D3D11 texture, since there's no way to get CPU accessible memory size without allocating real D3D11 texture. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2482>
* va: Use GST_CAPS_FEATURE_MEMORY_VA to replace "memory:VAMemory".He Junyan2021-08-161-0/+7
| | | | | | | | "memory:VAMemory" is a commonly used string which notates our VA-kind memory type. We now used a definition in va lib to replace the simply string usage. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2466>
* codecs: h264dec: Output the picture directly if already a frame.He Junyan2021-08-121-1/+1
| | | | | | | | | We forget one case that is the frame and field pictures may be mixed together. For this case, the dpb is interlaced while the last picture may be a complete frame. We do not need to cache that complete picture and should output it directly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2448>
* Use g_memdup2() where available and add fallback for older GLib versionsTim-Philipp Müller2021-08-054-11/+11
| | | | | | | g_memdup() is deprecated since GLib 2.68 and we want to avoid deprecation warnings with recent versions of GLib. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2280>
* d3d11: Disable packed and subsampled YUV formatsSeungha Yang2021-07-292-2/+17
| | | | | | | | Direct3D11 sampler doesn't support them very well, and conversion outputs usually result in poor visual quality with our shader code. Should disable support for such formats for now Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2344>
* codecs: h264dec: Improve the find_first_field_picture().He Junyan2021-07-281-31/+53
| | | | | | | | | | | We need to consider the first field of the last picture when the last picture can not enter the DPB. Another change is, when prev field's frame_num is not equal to the current field's frame_num, we should also return FASLE because it is also a case of losing some field. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2430>
* codecs: h264dec: consider the last field when add picture to DPB.He Junyan2021-07-281-6/+28
| | | | | | | | There are cases that the first field of the last picture is not a ref but the second field is a ref. We need to add both of them because the bumping always needs a complete frame in the DPB. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2430>
* codecs: h264dec: Consider the field case when directly output.He Junyan2021-07-281-5/+73
| | | | | | | | | | | For interlaced streams, it is also possible that the last frame is not able to be inserted into DPB when the DPB is full and the last frame is a non ref. For this case, we need to hold a extra ref for the first field of the last frame and wait for the complete frame with both top and bottom fields. For the progressive stream, the behaviour is unchanged. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2430>
* codecs: h264dec: Fix a error print of dpb_add.He Junyan2021-07-281-1/+1
| | | | | | | When the dpb is interlaced, the max size should be 2*dpb->max_num_frames, correcting the error print info for that. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2430>
* player: Add static keyword to _config_quark_tableImanol Fernandez2021-07-282-2/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2439>
* codecs: h264decoder: let print_ref_pic_list_b print the correct list name.He Junyan2021-07-231-10/+13
| | | | | | | | The print_ref_pic_list_b now not only needs to trace the ref_pic_list_b0/1, but also need to trace the ref_frame_list_0_short_term. We need to pass the name directly to it rather than an index to refer to ref_pic_list_b0/1. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2425>
* codecs: h264dec: Fix a typo in construct_ref_field_pic_lists_b.He Junyan2021-07-231-1/+2
| | | | | | | | The array sort of ref_frame_list_0_short_term has some typo. The typo makes this list not in the POC ascend order and generate wrong decoding result for interlaced streams. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2425>
* codecs: h264dec: Improve the algorithm for low latency mode.He Junyan2021-07-213-13/+149
| | | | | | | | | | | | | | In low_latency mode, try to bump the picture as soon as possible without the frames disorder: 1. We can directly output the continuous non-reference frame. 2. Consider max_num_reorder_frames, which is special useful for I-P mode. 3. Consider the leading pictures with negative POC. 4 Output small POC pictures when non-reference frame comes. 4. Output the POC increment<=2 pictures. This is not 100% safe, but in practice this condition can be used. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
* codecs: h264dec: Add help function of dpb_set_max_num_reorder_frames.He Junyan2021-07-213-10/+35
| | | | | | | The max_num_reorder_frames can be useful for bump check. We store it in the DPB and no need for the decoder now. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
* codecs: h264dec: Add a flag to record whether picture is reference.He Junyan2021-07-213-2/+11
| | | | | | | | | The picture->ref field will change from time to time according to decoder's state and reference sliding window. We need another flag to record whether the picture is a reference picture when it is created, and this can help the bumping check. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
* codecs: h264dec: Change the order of dpb_add and dpb_bump.He Junyan2021-07-211-33/+63
| | | | | | | | The current behavior is different from the SPEC. We should check and bump the DPB or drain the DPB before we insert the current picture into it. This may cause the output picture disorder. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
* codecs: h264dec: Modify the DPB need bump check.He Junyan2021-07-213-59/+41
| | | | | | | | | | | | | | | Accord to spec, we should not add the current picture into the DPB when we check whether it needs to bump, so the checks of the IDR and the "memory_management_control_operation equal to 5" are no needed. And the spec also says that the DPB only needs to bump when there is no empty frame buffer left(We handle the IDR cases in other places). We need to follow that and the max_num_reorder_frames is useless. We also minus 1 in has_empty_frame_buffer because the current frame has not been added yet. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
* codecs: h264dec: Make dpb_has_empty_frame_buffer a codecs API.He Junyan2021-07-212-1/+12
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
* codecs: h264dec: Set picture to a small poc when mem_mgmt_5.He Junyan2021-07-211-0/+16
| | | | | | | | | When current frame memory_management_control_operation equal to 5, that means we need to drain the dpb and the current picture act as an IDR frame. So it should have smaller poc than the later pictures to ensure the output order. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2373>
* codecs: h265decoder: Fix a typo of NumPocTotalCurr when process ref pic list.He Junyan2021-07-162-5/+5
| | | | | | | | | | | We should use the NumPocTotalCurr value stored in decoder, which is a calculated valid value, rather than use the invalid value in the slice header. Most of the time, the NumPocTotalCurr is 0 and make the tmp_refs a very short length, and causes the decoder's wrong result. By the way, the NumPocTotalCurr is not the correct name specified in H265 spec, its name should be NumPicTotalCurr. We change it to the correct name. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2414>
* codecs: h265decoder: Always free messages while parsing SEIMads Buvik Sandvei2021-07-141-1/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2390>
* codecs: vp9statefulparser: not init segmentation_abs_or_delta_update.He Junyan2021-07-131-1/+0
| | | | | | | The segmentation_abs_or_delta_update is a stateful var, it should not be inited every time when parsing the segmentation. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2403>
* codecparsers: av1: fix underflow in last_frame_idxDaniel Almeida2021-07-121-1/+1
| | | | | | | | | The spec mandates this field be parsed using unsigned arithmetic. Nevertheless, av1parser will use -1 apparently as an uninitialized value in gst_av1_parse_frame_header. This immediately underflows last_frame_idx though, since its type was defined as guint8. Fix this by converting to gint8. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2401>
* play: Emit correct signalGuido Günther2021-07-121-2/+1
| | | | | | | SIGNAL_MEDIA_INFO_UPDATED should be emitted on media info changes, not SIGNAL_VIDEO_DIMENSIONS_CHANGED. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2398>
* vulkan: Declare missing auto-pointer cleanup functions.Víctor Manuel Jáquez Leal2021-07-1212-6/+24
| | | | | | | Also removed a couple guards since, given the glib dependency, they are set. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2396>
* vulkan: filter: Use filter variable name for choosing queue.Víctor Manuel Jáquez Leal2021-07-121-4/+4
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2396>
* gst-libs/gst/wayland: handle display passing betterDominique Martinet2021-07-091-3/+6
| | | | | | | | | | | | | | | | failure to pass a display in 'handle' would result in uninitialized value being returned, which would often segfault later down the road when trying to initialize gstreamer context with it. Check the return value of gst_structure_get() to make sure we return valid data. Furthermore, the gstglimagesink in gst-plugins-base also has a similar mechanism but uses 'display' as field name to pass the value; instead of requiring the application to behave differently depending on what sink was automatically detected just try to read both values here, with display being the new default. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2292>
* codecs: h265dec: Disable the POC order warning for negative POC.He Junyan2021-07-061-3/+5
| | | | | | | | | There may be leading frames after the IRAP frames, which has negative POC. This kind of frames are allowed and they will be displayed before the IRAP frame. So the warning should not be triggered for them. Init the last_output_poc to G_MININT32 can avoid this. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2380>
* codecs: h264dec: Disable the POC order warning for negative POC.He Junyan2021-07-061-2/+4
| | | | | | | | | There may be leading frames after the IDR frame, which has negative POC. This kind of frames are allowed and they will be displayed before the IDR frame. So the warning should not be triggered for them. Init the last_output_poc to G_MININT32 can avoid this. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2380>
* codecparsers: vp9statefulparser: Fix the gst_vp9_get_qindex clamp issue.He Junyan2021-07-021-1/+1
| | | | | | | | The alternate quantizer is a delta value and should be int type. We mark it wrongly as uint, that will make CLAMP (data, 0, 255) always choose 255 rather than 0 if the data < 0. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2369>