Commit graph

1752 commits

Author SHA1 Message Date
U. Artie Eoff
1ce66e2ed5 libs: encoder: h264_fei: fix potential overflow before widen
Found by static analysis. encoder->mb_width * encoder->mb_height
is evaluated using 32-bit arithmetic before widen.  Thus, cast
at least one of these to guint64 to avoid overflow.
2019-09-19 11:17:27 -07:00
U. Artie Eoff
2bfef5a454 libs: encoder: h264_fei: remove dead error condition
Found by static analysis.  The feipak is always null
when we reach the error target.
2019-09-19 10:56:57 -07:00
U. Artie Eoff
9c46c15e51 libs: utils: add missing break in switch 2019-09-19 10:56:46 -07:00
He Junyan
f5e1946036 libs: video-format: Make all YUV format available
The YUV formats have no ambiguity for drivers, so we can add them all.
Some old driver(i965) does not implement full get/put image functions
but can use derive image funtions for the YUV format. It does not
report that kind of formats correctly in image query, but will derive
that YUV format image from surface. The dynamic mapping of YUV format
will block that manner.
Adding more YUV format mapping has no side effect. So considering the
legacy driver conformance, we add all YUV formats mapping statically
and dynamic mapping RBG formats

Fix: #189
Fix: #190
2019-09-18 09:05:02 +00:00
Matthew Waters
499e248d4c egl: Fix racyness in display thread creation
Multiple different scenarios could break the display thread creation and
end up blocking waiting for thread o be created.  Fix them all by
correctly waiting for a new boolean to become valid.
2019-09-18 05:36:52 +00:00
Matthew Waters
2e8cdac059 egl: don't advertise a wrapped EGLContext as actually wrapped
It's not actually wrapped as we create a new EGLContext from the passed
in EGLContext.  As a result, the created EGLContext was never destroyed.
2019-09-18 05:36:52 +00:00
He Junyan
6693be476c libs: h264decoder: do not return error for unhandled NAL unit.
Some streams have error data introducing unknown NAL type. There are
also kinds of NAL types we do not want to handle. The old manner will
set a decoder error when encounter this, which cause a latent crash bug.
The decoder may successfully decode the picture and insert it into DPB.
But there are error NAL units after the AU which cause the post unit error
and make that frame dropped. The later output of the picture still want
to ref that frame and crash.
No need to set decoder error when can not recognize or handle the NAL
unit, just skip it and continue.

Fix: #191
2019-09-17 10:54:37 +08:00
Víctor Manuel Jáquez Leal
f0d6263318 libs: encoders: use GST_PARAM_USER_SHIFT to define internal params
This patch makes use of GST_PARAM_USER_SHIFT to define the internal
param in encoders to decide which parameters to expose. Thus
gstreamer-vaapi will not interfere with any change in GStreamer in the
future.

Also, the internal symbol was change to
GST_VAAPI_PARAM_ENCODER_EXPOSURE to keep the namespacing.
2019-09-11 14:32:22 +02:00
He Junyan
b5dd169420 libs: Add BGR10A2_LE support for color space conversion.
Fix: #179
2019-09-10 12:49:39 +00:00
He Junyan
5168611f55 libs: surface: add pointer check for surface_new_from_formats.
The command line:
  gst-launch-1.0 filesrc location=some_name.mjpeg ! jpegparse !
  vaapijpegdec !  videoconvert ! video/x-raw,format=I420 ! vaapisink
will crash on i965 driver because of no pointer check.

We now generate the video format map between GST format and VA format
dynamically based on the image format returned by vaQueryImageFormats.
i965 driver does to report image format of 444P and Y800 forcc, while
the jpeg decoder context VASurfaceAttribPixelFormat use them. We can
not recognize these format and pass a NULL pointer to
gst_vaapi_surface_new_from_formats.
We need to add a pointer check here and let the fallback logic handle
this case correctly.
Other drivers work well.
2019-09-10 12:32:58 +00:00
Víctor Manuel Jáquez Leal
8d8743a494 libs: utils: guard the VAEntrypointFEI symbol
VAEntrypointFEI appeared in libva 2.0.0 (API version 1.0.0)
2019-09-07 13:35:49 +02:00
He Junyan
32bf6f1e09 libs: video-format: Refine the video format mapping.
Improve the mapping between va format and gst format. The new map
will be generated dynamically, based on the query result of image
format in VA driver. Also consider the ambiguity of RGB color
format in LSB mode.
2019-09-06 16:43:14 +00:00
He Junyan
f52d545fd0 libs: encoder: clean two virtual func in encoder class
set_property and get_default_properties functions are no longer
needed for encoder class.
2019-08-30 21:21:04 +08:00
He Junyan
6a590052fc libs: encoder: delete old set_property and property enum feienc264 2019-08-30 21:21:04 +08:00
He Junyan
64f8f62021 libs: encoder: delete old set_property and property enum in h264 fei 2019-08-30 21:21:04 +08:00
He Junyan
617ffd8156 libs: encoder: delete old set_property and property enum in vp9 2019-08-30 21:21:04 +08:00
He Junyan
c92b4f1bb7 libs: encoder: delete old set_property and property enum in vp8 2019-08-30 21:21:04 +08:00
He Junyan
3dcd79e439 libs: encoder: delete old set_property and property enum in mpeg2 2019-08-30 21:21:04 +08:00
He Junyan
1b85ce4882 libs: encoder: delete old set_property and property enum in jpeg 2019-08-30 21:21:04 +08:00
He Junyan
c70dbb0b79 libs: encoder: delete old set_property and property enum in h265 2019-08-30 21:21:04 +08:00
He Junyan
c028d7a413 libs: encoder: delete old set_property and property enum in h264 2019-08-30 21:21:04 +08:00
He Junyan
adcb448276 libs: encoder: delete EncoderPropInfo related functions 2019-08-30 21:21:04 +08:00
He Junyan
25b6be1780 libs: encoder: delete encoder_set_property
We no longer need this obsolete set_property function now after
switch to standard gobject's property manner.
Also delete the old encoder's property enum in the header file.
2019-08-30 21:21:04 +08:00
He Junyan
69f7c95a29 libs: encoder: delete properties_get_default for base class 2019-08-30 21:21:04 +08:00
He Junyan
8ce90bca1e libs: encoder: delete 3 useless init macro 2019-08-30 21:21:04 +08:00
He Junyan
80992191a3 libs: encoder: delete get_default_properties of feienc 2019-08-30 21:21:04 +08:00
He Junyan
8ac7dd556b libs: encoder: delete get_default_properties of H264 Fei 2019-08-30 21:21:04 +08:00
He Junyan
f65647ec25 libs: encoder: delete get_default_properties of VP9 2019-08-30 21:21:04 +08:00
He Junyan
c5cf07631d libs: encoder: delete get_default_properties of VP8 2019-08-30 21:21:04 +08:00
He Junyan
1ca6a42e27 libs: encoder: delete get_default_properties of MPEG2 2019-08-30 21:21:04 +08:00
He Junyan
665a121b51 libs: encoder: delete get_default_properties of JPEG 2019-08-30 21:21:04 +08:00
He Junyan
0ce9f6e637 libs: encoder: delete get_default_properties of H265 2019-08-30 21:21:04 +08:00
He Junyan
fe369fb523 libs: encoder: delete get_default_properties of H264 2019-08-30 21:21:04 +08:00
He Junyan
511a48da56 libs: encoder: delete the useless constructed func for encoder. 2019-08-30 21:21:04 +08:00
He Junyan
eb17703d43 libs: encoder: implement get_view_ids for h264 encoder. 2019-08-30 21:21:04 +08:00
He Junyan
1256680486 gst: encode: enable new type of property mechanism. 2019-08-30 21:19:14 +08:00
He Junyan
bc2f8fd19e libs: encoder: add flags to all encoder properties.
G_PARAM_CONSTRUCT make all properties init correctly, we do not
need to init the properties manually.
G_PARAM_FLAG_VAAPI_ENCODER_EXPOSURE is a vaapi encoder specific
flag, means need to expose the property to according encode class.
2019-08-30 18:39:32 +08:00
He Junyan
46c8b425dd libs: encoder: Add properties for h264 encoder fei.
Install properties for h264 encoder fei class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 18:03:43 +08:00
He Junyan
a65847b2ad libs: encoder: Add properties for h264 fei encoder.
Install properties for h264 fei encoder class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 16:59:23 +08:00
He Junyan
30e79a0940 libs: encoder: Add properties for vp9 encoder.
Install properties for vp9 encoder class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 16:17:35 +08:00
He Junyan
ba41bcddc6 libs: encoder: Add properties for vp8 encoder.
Install properties for vp8 encoder class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 16:13:24 +08:00
He Junyan
8212c0552e libs: encoder: Add properties for mpeg2 encoder.
Install properties for mpeg2 encoder class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 14:06:09 +08:00
He Junyan
8641c27a13 libs: encoder: Add properties for jpeg encoder.
Install properties for jpeg encoder class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 14:01:23 +08:00
He Junyan
9348ed9e1c libs: encoder: Add properties for h265 encoder.
Install properties for h265 encoder class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 13:54:52 +08:00
He Junyan
3468edc20b libs: encoder: Add properties for h264 encoder.
Install properties for h264 encoder class. Also set the new get/set
property functions for gobject class. Still use the old properties
way now and this new feature will be enabled later.
2019-08-30 13:42:54 +08:00
He Junyan
beaf45cc6f libs: encoder: add properties and prop help functions
Add all common properties to encoder base class. rate-control and
tune are moved to sub class.
2019-08-30 13:30:04 +08:00
He Junyan
6978eae21a libs: encoder: delete useless gst_vaapi_encoder_new func.
GstVaapiEncoder is a abstract gobject and never be created directly.
2019-08-30 13:06:50 +08:00
He Junyan
c4a47f91ba lib: encoder: gstobjectfy all vaapi encoders.
Replace all gstvaapiobject in vaapi encoders with standard gstobject.
Let the gstobject common logic to handle all the init and finalize
works. But the property install/set/get still use the old way, need
to be improved later.
2019-08-30 13:05:50 +08:00
He Junyan
51963b1a74 libs: util: Fix a memory leak in config_surface_attributes_get 2019-08-27 01:30:36 +08:00
Víctor Manuel Jáquez Leal
b36eea201f libs: remove context's overlay
The context overlay was an optimization to apply a video composition
to all the surfaces bound to a context.

But since commit 18031dc6 this optimization was disabled, so it is
better just get rid of it.
2019-08-20 17:12:32 +02:00