summaryrefslogtreecommitdiff
path: root/gst-libs
AgeCommit message (Collapse)AuthorFilesLines
2017-08-09libs: decoder: h265: remove spurious codeHEADmasterVíctor Manuel Jáquez Leal1-6/+1
Coverity scan: Logically dead code: The indicated dead code may have performed some action; that action will never occur. By using pointer arithmetic is impossible to get NULL.
2017-08-08libs: context: use attribs index instead pointersVíctor Manuel Jáquez Leal1-10/+18
Coverity scan bug: Out-of-bounds write. This could cause an immediate crash or incorrect computations. Coverity basically found that it is possible to assign more than 4 attribs in the array. In my opinion this was produced because code pattern used pointer arithmetic, which is not readable nor maintainable. This patch refactors config_create() to use an array index rather than pointer arithmetic. Also a run-time check for index size was added.
2017-08-08libs: windows: wayland: fail if cannot remove last frameVíctor Manuel Jáquez Leal1-4/+7
Converity scan bug: If the function returns an error value, the error value may be mistaken for a normal value. If g_atomic_pointer_compare_and_exchange() fails because the frame is not the last one, the function fails. Thus, logging an info message.
2017-08-08libs: utils: glx: check return valueVíctor Manuel Jáquez Leal1-3/+7
Coverity scan bug: If the function returns an error value, the error value may be mistaken for a normal value. Function sscanf returns the number of assignations done. Validate this return value with the number of expected variables to match.
2017-08-08libs: vaapi: object: remove unrequired NULL checkVíctor Manuel Jáquez Leal1-1/+1
Coverity scan bug: Dereference after null check: Either the check against null is unnecessary, or there may be a null pointer dereference. Variable klass has been validated as non-NULL several time before in gst_vaapi_object_new() function, so there is no need to check it again.
2017-08-08libs: encoder: h265: remove spurious assignationVíctor Manuel Jáquez Leal1-1/+0
Coverity scan bug: An assigned value that is never used may represent unnecessary computation, an incorrect algorithm, or possibly the need for cleanup or refactoring. ip_period is assigned first to be rewritter inmediatly after. The first assignation is spurious.
2017-08-08libs: encoder: h264: fix copy & paste errorVíctor Manuel Jáquez Leal1-1/+1
Coverity scan bug: The copied code will not have its intended effect. This is a bug from commit cdaf15b2, where the intention is to initialize RefPicList1 while setting RefPicList0.
2017-08-08libs: encoder: h265: fix possible integer overflowVíctor Manuel Jáquez Leal2-2/+4
Coverity scan bug: Unintentional integer overflow. The expression's value may not be what the programmer intended, because the expression is evaluated using a narrow (i.e. few bits) integer type. Cast operator to guint64 before computation to avoid narrowing. merge with 3c5a6add
2017-08-08libs: decoder: mpeg4: fail if return value is not OKVíctor Manuel Jáquez Leal1-0/+6
Coverity scan bug: An assigned value that is never used may represent unnecessary computation, an incorrect algorithm, or possibly the need for cleanup or refactoring. In the return value of decode_slice() or gst_mpeg4_parse_video_packet_header() are not success, thus fail decode_packet() function.
2017-08-08libs: decoder: h265: check for nullVíctor Manuel Jáquez Leal1-2/+4
Coverity scan bug: Dereference after null check: Either the check against null is unnecessary, or there may be a null pointer dereference. While looking for hte lowest poc, according to rest of the code, the picture in the dbp (decoded picture buffer) might be NULL, thus we could check for a NULL picture before assigned as found. Also, split a comma operator because it is considered as a bad practice because it possible side effects.
2017-08-08libs: decoder: h265: untaint loop control variableVíctor Manuel Jáquez Leal1-1/+11
Coverity scan bug: Scalars (for example, integers) are not properly bounds-checked (sanitized) before being used as array or pointer indexes, loop boundaries, or function arguments are considered as tainted. In this case, num_nals were not checked before used as loop control.
2017-08-08libs: decoder: h264: remove unrequired NULL checkVíctor Manuel Jáquez Leal1-5/+2
Coverity scan bug: Dereference after null check: Either the check against null is unnecessary, or there may be a null pointer dereference. In the original commit for fill_picture_gaps() (commit 5abd2b90) the prev_picture could be NULL, that's why the code did a null check. But, since commit 52adebe7, the previous reference frames are tracked, thus there is no need to check null anymore.
2017-08-03libs: decoder: h264: decode MVC base view onlyorestisf1-4/+3
If processed SPS has mvc profile and the configuration is set to base-only, the frame is drop. https://bugzilla.gnome.org/show_bug.cgi?id=732265
2017-08-03libs: decoder: h264: add setter for base-only modeorestisf2-0/+23
https://bugzilla.gnome.org/show_bug.cgi?id=732265
2017-08-02libs: encoder: h264: missing property enum documentationVíctor Manuel Jáquez Leal1-0/+1
2017-08-02libs: encoder: h264: add multi reference supportHyunjun Ko1-19/+17
Using num_ref_frames provided and the result of the Query VAConfigAttribEncMaxRefFrames, it determines the size of reference list and perform encoding with multi reference frames as the following: 1\ The num_ref_frames is being considered as the number of reference picture list0 2\ Encoder adds 1 reference frame more to the reference picture list1 internally if b-frame encoding. 3\ If num_ref_frames is bigger than the number of refrence frames supported in the driver, it will be lowered. https://bugzilla.gnome.org/show_bug.cgi?id=783803
2017-08-02libs: encoder: h264: add refs propertyHyunjun Ko2-0/+18
Users can provide the number of reference frame by this property. The value of the property will be considered as the number of reference picture list0 and will add 1 reference frame more to the reference picture list1 internally if b-frame encoding. If the value provided is bigger than the number of refrence frames supported in the driver, it will be lowered. https://bugzilla.gnome.org/show_bug.cgi?id=783803
2017-08-02libs: encoder: implements gst_vaapi_encoder_ensure_max_num_ref_framesHyunjun Ko2-0/+53
This function will query VAConfigAttribEncMaxRefFrames to get the maximum number of reference frames supported in the driver. This will be used for h264/h265 encoding. https://bugzilla.gnome.org/show_bug.cgi?id=783803
2017-08-01libs: display: when appending formats change pointers to indexesTomas Rataj1-12/+12
Thus, it fixes an invalid read when YV12 or I420 are not supported by the driver. https://bugzilla.gnome.org/show_bug.cgi?id=785085
2017-08-01libs: encoder: h264: Add uncompliant mode reducing coded buffer sizeSreerenj Balachandran2-0/+71
Added a new property "compliance-mode", which default is the normal strict compliant mode. The second mode, "restrict-buf-alloc", is to limit the coded buffer allocation size to improve performance in some specific Intel platforms (there is asignificant performance improvement in parallel encodings). Under this new mode, we use the MinCR field in A.3.1 for pre-calculating the coded-buffer size. https://bugzilla.gnome.org/show_bug.cgi?id=784590
2017-08-01libs: utils_h264: Extend LevelLimit table with MinCR fieldSreerenj Balachandran2-18/+20
Add MinCR(Minimum Compression Ratio) field to GstVaapiH264LevelLimits based on Annex A.3 https://bugzilla.gnome.org/show_bug.cgi?id=784590
2017-07-31libs: utils: libva 1.0 changed the loggingVíctor Manuel Jáquez Leal1-4/+35
The logging mechanism in libva has changed it's functions signatures. This patch updates that for libva versions >= 1.0 https://bugzilla.gnome.org/show_bug.cgi?id=784398
2017-07-31libs: decoder: h264: libva 1.0 deprecated baselineVíctor Manuel Jáquez Leal1-0/+3
libva 1.0 deprecated H.264 baseline profile and FMO support (commit b4f332b3). https://bugzilla.gnome.org/show_bug.cgi?id=784398
2017-07-26build: meson: remove gstvaapidisplaycache.cVíctor Manuel Jáquez Leal1-1/+0
This is a missing bit of commit ec3e10f6
2017-07-18libs: display: x11: add gst_vaapi_display_x11_new_with_va_display()Hyunjun Ko2-0/+19
Implements new API function so that users could create GstVaapiDisplay with their own VADisplay within a native display as backend. https://bugzilla.gnome.org/show_bug.cgi?id=766704
2017-07-18libs: display: pass display info when foreign displayHyunjun Ko1-13/+27
When creating a GstVaapiDisplay using a foreign VADisplay, and render with that display, it also requires native display of the backend. https://bugzilla.gnome.org/show_bug.cgi?id=766704
2017-07-18libs: display: remove cacheVíctor Manuel Jáquez Leal8-758/+16
Remove a bunch of code that handles the VADisplay cache, since the context sharing should be doing this correctly. https://bugzilla.gnome.org/show_bug.cgi?id=747946
2017-07-17libs: encoder: vp9: array terminated in zerosVíctor Manuel Jáquez Leal1-1/+2
There is a crash when setting ref-pic-mode since the #GEnumValue array is not terminated with a structured with all memvers being zero. https://bugzilla.gnome.org/show_bug.cgi?id=785032
2017-07-10libs: decoder: h264: push frames as soon as possibleMatt Staples1-5/+68
Push frames downstream as soon as possible instead of waiting until they are ejected from the DPB. This patch makes the decoder not comply with the H.264 specification, but it is required for some video cameras. https://bugzilla.gnome.org/show_bug.cgi?id=762509 Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2017-07-07libs: decoder: h264: add getter/setter for low latency modeVíctor Manuel Jáquez Leal2-0/+45
https://bugzilla.gnome.org/show_bug.cgi?id=783588
2017-07-04libs: encoder: h264: submit sps in case of IDR pictureHyunjun Ko1-2/+5
If the picture is IDR, also submit a SPS header. This means when frame number reaches to keyframe-period or an force key unit event arrives, we insert SPS/PPS again. https://bugzilla.gnome.org/show_bug.cgi?id=776712
2017-07-04libs: encoder: h264: set the frame as IDR if forced key unitHyunjun Ko1-2/+4
GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME() is a flag usually used to manage the `frame-lost` event in the case of streaming, such as RTP. In case of this event, it is needed to start new GOP rather than just produce an I-frame. https://bugzilla.gnome.org/show_bug.cgi?id=776712
2017-07-04libs: encoder: h264: insert AU delimiterSreerenj Balachandran2-0/+76
Insert an AUD as the first NAL of each encoded frame. Some applications require Access Unit Delimiter for decoding the stream. The AU delimeter insertion is done only when the aud parameter is TRUE (by default is disabled). The reason of this it is because this header is only available from Intel Gen9 and the VA intel driver should be 1.8 or superior. Otherwise, the output will be corrupted. https://bugzilla.gnome.org/show_bug.cgi?id=776712 Signed-off-by: Victor Jaquez <vjaquez@igalia.com>
2017-07-04libs: encoder: h264: initialize all elements of view_idsHyunjun Ko1-1/+1
Currently when num_views is changed by multiview-mode on sink caps, it produces wrong MVC encoded stream since the array view_ids is not set properly according to changed num_views. So this patch initializes all of the array sequentially to handle this case. Side effect is not going to happen by this patch since this array is being handled by num_views. https://bugzilla.gnome.org/show_bug.cgi?id=784321
2017-07-03Revert "encoder: h264: Use high profile by default"Hyunjun Ko1-3/+3
This reverts commit 4aec5bdd7207fc0e45813ef14c9c0ad5174a8f75. https://bugzilla.gnome.org/show_bug.cgi?id=757941
2017-07-03libs: encoder: h264: set profile via capsfilterHyunjun Ko1-12/+22
Until now, the encoder ignored the profile in src caps and chose one according with the given parameters. But the encoder must honor the profile specifed in src caps. This patch do that, and if the encoder needs to choose the profile, it will do it by following these rules: 1\ If given parameters are not compatible with given profile, the encoder will bail out with an error. 2\ The encoder will choose the higher profile indicated in the src caps. https://bugzilla.gnome.org/show_bug.cgi?id=757941
2017-06-15libs: decoder: h264: initialize active_sps/pps in resetHyunjun Ko1-0/+2
Since commits in https://bugzilla.gnome.org/show_bug.cgi?id=781142 landed, they introduced regression in seek. Formerly, once seek is done, decoder drops P-frames until I-frame arrives. But since the commits landed, it doesn't drop P-frame and does try to decode it continuously because active_sps is still alive. See ensure_sps function. But there are prev_frames and prev_ref_frames reset already, then it causes assertion. So it's necessary to reset active_sps/pps also in reset method. https://bugzilla.gnome.org/show_bug.cgi?id=783726
2017-06-15libs: encoder: fix compilation with old versions of libvaVíctor Manuel Jáquez Leal2-3/+7
There are some symbols that are not used when compiling with old version of libva and those generates a compilation error. Original-patch-by: Matt Staples <staples255@gmail.com>
2017-06-13libs: encoder: Fix the quality level clampingSreerenj Balachandran1-5/+5
Change the hard-coded range of quality-level from {1-8} to {1-7}, since it is the range Intel Open source driver supports. Also perform the range clamping only if the user provided quality-level is greater than the max-range suppored by the driver, because there could be non-intel drivers giving lower value than the hard-coded max value 7. https://bugzilla.gnome.org/show_bug.cgi?id=783567
2017-06-13libs: encoder: log out the name of the profileVíctor Manuel Jáquez Leal6-6/+12
Instead of printing a number, it is more readable to log out, in case of error, the name of the failing profile.
2017-06-13libs: encoder: h264: changes raw number of profile to macro name of itsHyunjun Ko1-4/+5
Changes raw number of profile to macro name of its to improve readability. https://bugzilla.gnome.org/show_bug.cgi?id=757941
2017-06-08libs: encoder: set framerate if bigger than 0/1Víctor Manuel Jáquez Leal1-3/+7
Just set the framerate parameter if the framerate numerator and denominator are bigger than zero. Otherwise, in Intel Gen6 driver, a warning is raised disabling the bitrate control. Original-patch-by: Hyunjun Ko <zzoon@igalia.com> https://bugzilla.gnome.org/show_bug.cgi?id=783532
2017-06-07libs: encoder: bitrate target percentage calculationVíctor Manuel Jáquez Leal1-2/+6
If the rate control is set to Constant Bit Rate (CBR) the target percentage is 100%, otherwise is 70%
2017-06-07libs: encoder: h264,h265,mpeg2,vp8,vp9: refactor ratecontrol paramVíctor Manuel Jáquez Leal6-43/+30
Centralize the common configuration for the Rate Control parameter, thus can be overloaded per each specific encoder.
2017-06-07libs: encoder: h264,h265,mpeg2,vp8,vp9: refactor framerate paramVíctor Manuel Jáquez Leal6-30/+4
Since the framerate VA parameter is calculated equally among all the encoders, it is better to handle it in the base encoder class.
2017-06-07libs: encoder: vp9: Adds CBR and VBR Encoding supportSreerenj Balachandran2-2/+102
https://bugzilla.gnome.org/show_bug.cgi?id=766832 Signed-off-by: Hyunjun Ko <zzoon@igalia.com> Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2017-06-07libs: encoder: vp8: Adds VBR Encoding supportHyunjun Ko1-2/+5
https://bugzilla.gnome.org/show_bug.cgi?id=778732
2017-06-07libs: encoder: h265: Adds VBR Encoding supportHyunjun Ko1-4/+7
Enables Variable BitRate mode, which does set FrameRate and RateControl parameters. https://bugzilla.gnome.org/show_bug.cgi?id=778732
2017-06-07libs: encoder: Describes more detail about the bitrate propertyHyunjun Ko1-0/+11
https://bugzilla.gnome.org/show_bug.cgi?id=778732
2017-06-07libs: encoder: h265: add rate control parameterVíctor Manuel Jáquez Leal1-0/+11
https://bugzilla.gnome.org/show_bug.cgi?id=783449