Commit graph

6 commits

Author SHA1 Message Date
Gwenole Beauchesne
449ac54348 vaapiencode: fix negotiation process of output caps.
The specified caps in gst_video_encoder_set_output_state() function
arguments should not contain any resolution, pixel-aspect-ratio,
framerate, codec-data et al. Those rather should be set through the
returned GstVideoCodecState. This means that output caps creation
could be delayed until before gst_video_encoder_finish_frame() is
called.

This greatly simplifies the GstVideoEncoder::set_format() callback
by the way.
2014-01-13 17:31:55 +01:00
Gwenole Beauchesne
a43d06dcf5 vaapiencode: update for new properties API.
Update MPEG-2 and H.264 encode elements to cope with the new core
libgstvaapi properties API. i.e. all configurable properties are now
directly handled at the GstVaapiEncoder level.

Besides, this also makes sure to not use or modify the GstVaapiEncoder
private definitions directly. Private data need to remain private.

https://bugzilla.gnome.org/show_bug.cgi?id=719529
2014-01-13 17:31:55 +01:00
Gwenole Beauchesne
8116d8a50e vaapiencode: additional clean-ups.
Constify pointers wherever possible. Drop unused variables, and use
consistent variable names. Fix gst_vaapiencode_h264_allocate_buffer()
to correctly report errors, especially when in-place conversion from
bytestream to avcC format failed.
2013-11-28 15:17:42 +01:00
Gwenole Beauchesne
d759fe34e6 vaapiencode: move common properties to base class.
Move "rate-control" mode and "bitrate" properties to the GstVaapiEncode
base class. The actual range of supported rate control modes is currently
implemented as a plug-in element hook. This ought to be determined from
the GstVaapiEncoder object instead, i.e. from libgstvaapi.
2013-11-28 14:05:33 +01:00
Gwenole Beauchesne
e01d48feba vaapiencode: minor clean-ups.
Add a GST_VAAPIENCODE_CAST() helper to avoid run-time checks against
the GObject type system. We are guaranteed to only deal with the same
plug-in element object.
2013-11-26 17:08:31 +01:00
Wind Yuan
f1c33feef9 plugins: add h264 encoder element.
Add GstVaapiEncodeH264 element object. The actual plug-in element
is called "vaapiencode_h264".

Valid properties:
- rate-control: rate control mode (default: none)
- bitrate: desired bitrate in kbps (default: auto-calculated)
- key-period: maximal distance between two key frames (default: 30)
- num-slices: number of slices per frame (default: 1)
- max-bframes: number of B-frames between I and P (default: 0)
- min-qp: minimal quantizer (default: 1)
- init-qp: initial quantizer (default: 26)

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-11-24 16:52:05 +01:00