Commit graph

1746 commits

Author SHA1 Message Date
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
Víctor Manuel Jáquez Leal
dae057588b libs: remove surface's parent context
In commit 18031dc6 surface's parent context is not assigned because of
circular references. Since then (2013), there's has no issue with
subpictures attached to a context, the current only users of this API.

This patch cleans up all of related code with the unused surface's
parent context.
2019-08-20 17:11:23 +02:00
Víctor Manuel Jáquez Leal
f88d18bebe vaapipostproc: append frame size restrictions in caps 2019-08-19 17:26:55 +00:00
Víctor Manuel Jáquez Leal
13e369aad6 libs: profilecaps: refactor common code 2019-08-19 17:26:55 +00:00
Víctor Manuel Jáquez Leal
3ba3966fc3 vaapiencode: enhance how the profile is defined
This code doesn't define the profile used by the internal encoder, but
it used to "predict" which is going to be used and to get the caps
restrictions.

Before the profile was predicted by checking the donwstream caps, but
sometimes they are not defined, setting an unknown profile. In order
to enhances this situation, the encoder asks to internal encoder if it
has one. If so, it is used.

To ask the internal encoder's profile a new accessor function was
added: gst_vaapi_encoder_get_profile()
2019-08-19 17:26:55 +00:00
Víctor Manuel Jáquez Leal
bd3d347fd7 libs: profilecaps: defines gst_vaapi_profile_caps_append_encoder()
Previously it was just a boilerplate. Now it is real implementation.
2019-08-19 17:26:55 +00:00
Víctor Manuel Jáquez Leal
ab4ba47bbf libs: utils: treat va_rt_format as bitwise flag
The return value of vaGetConfigAttributes() of VAConfigAttribRTFormat
is a bitwise flag with *all* the supported chroma types.

Previously it was assumed that the return value was a single value,
thus when returning the GST_VAAPI_CHROMA_TYPE_XXX the code was a
simple case. But it is wrong.

This patch changes the case block with a sequence of ifs testing the
bitwise. For now we assume a "priority" list in the testing sequence.
2019-08-19 17:26:55 +00:00