mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
decoder: re-indent GstVaapiDecoder base object.
This commit is contained in:
parent
14e9d383e3
commit
1b79049317
3 changed files with 721 additions and 737 deletions
|
@ -339,8 +339,8 @@ decode_step(GstVaapiDecoder *decoder)
|
|||
}
|
||||
|
||||
if (got_frame) {
|
||||
ps->current_frame->input_buffer = gst_adapter_take_buffer(
|
||||
ps->output_adapter,
|
||||
ps->current_frame->input_buffer =
|
||||
gst_adapter_take_buffer (ps->output_adapter,
|
||||
gst_adapter_available (ps->output_adapter));
|
||||
|
||||
status = do_decode (decoder, ps->current_frame);
|
||||
|
@ -836,11 +836,8 @@ gst_vaapi_decoder_get_frame_with_timeout(GstVaapiDecoder *decoder,
|
|||
}
|
||||
|
||||
void
|
||||
gst_vaapi_decoder_set_picture_size(
|
||||
GstVaapiDecoder *decoder,
|
||||
guint width,
|
||||
guint height
|
||||
)
|
||||
gst_vaapi_decoder_set_picture_size (GstVaapiDecoder * decoder,
|
||||
guint width, guint height)
|
||||
{
|
||||
GstVideoCodecState *const codec_state = decoder->codec_state;
|
||||
gboolean size_changed = FALSE;
|
||||
|
@ -848,16 +845,14 @@ gst_vaapi_decoder_set_picture_size(
|
|||
if (codec_state->info.width != width) {
|
||||
GST_DEBUG ("picture width changed to %d", width);
|
||||
codec_state->info.width = width;
|
||||
gst_caps_set_simple(codec_state->caps,
|
||||
"width", G_TYPE_INT, width, NULL);
|
||||
gst_caps_set_simple (codec_state->caps, "width", G_TYPE_INT, width, NULL);
|
||||
size_changed = TRUE;
|
||||
}
|
||||
|
||||
if (codec_state->info.height != height) {
|
||||
GST_DEBUG ("picture height changed to %d", height);
|
||||
codec_state->info.height = height;
|
||||
gst_caps_set_simple(codec_state->caps,
|
||||
"height", G_TYPE_INT, height, NULL);
|
||||
gst_caps_set_simple (codec_state->caps, "height", G_TYPE_INT, height, NULL);
|
||||
size_changed = TRUE;
|
||||
}
|
||||
|
||||
|
@ -866,11 +861,8 @@ gst_vaapi_decoder_set_picture_size(
|
|||
}
|
||||
|
||||
void
|
||||
gst_vaapi_decoder_set_framerate(
|
||||
GstVaapiDecoder *decoder,
|
||||
guint fps_n,
|
||||
guint fps_d
|
||||
)
|
||||
gst_vaapi_decoder_set_framerate (GstVaapiDecoder * decoder,
|
||||
guint fps_n, guint fps_d)
|
||||
{
|
||||
GstVideoCodecState *const codec_state = decoder->codec_state;
|
||||
|
||||
|
@ -888,11 +880,8 @@ gst_vaapi_decoder_set_framerate(
|
|||
}
|
||||
|
||||
void
|
||||
gst_vaapi_decoder_set_pixel_aspect_ratio(
|
||||
GstVaapiDecoder *decoder,
|
||||
guint par_n,
|
||||
guint par_d
|
||||
)
|
||||
gst_vaapi_decoder_set_pixel_aspect_ratio (GstVaapiDecoder * decoder,
|
||||
guint par_n, guint par_d)
|
||||
{
|
||||
GstVideoCodecState *const codec_state = decoder->codec_state;
|
||||
|
||||
|
@ -913,9 +902,12 @@ static const gchar *
|
|||
gst_interlace_mode_to_string (GstVideoInterlaceMode mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case GST_VIDEO_INTERLACE_MODE_PROGRESSIVE: return "progressive";
|
||||
case GST_VIDEO_INTERLACE_MODE_INTERLEAVED: return "interleaved";
|
||||
case GST_VIDEO_INTERLACE_MODE_MIXED: return "mixed";
|
||||
case GST_VIDEO_INTERLACE_MODE_PROGRESSIVE:
|
||||
return "progressive";
|
||||
case GST_VIDEO_INTERLACE_MODE_INTERLEAVED:
|
||||
return "interleaved";
|
||||
case GST_VIDEO_INTERLACE_MODE_MIXED:
|
||||
return "mixed";
|
||||
}
|
||||
return "<unknown>";
|
||||
}
|
||||
|
@ -937,7 +929,8 @@ gst_vaapi_decoder_set_interlace_mode(GstVaapiDecoder *decoder,
|
|||
}
|
||||
|
||||
void
|
||||
gst_vaapi_decoder_set_interlaced(GstVaapiDecoder *decoder, gboolean interlaced)
|
||||
gst_vaapi_decoder_set_interlaced (GstVaapiDecoder * decoder,
|
||||
gboolean interlaced)
|
||||
{
|
||||
gst_vaapi_decoder_set_interlace_mode (decoder,
|
||||
(interlaced ?
|
||||
|
@ -946,10 +939,8 @@ gst_vaapi_decoder_set_interlaced(GstVaapiDecoder *decoder, gboolean interlaced)
|
|||
}
|
||||
|
||||
gboolean
|
||||
gst_vaapi_decoder_ensure_context(
|
||||
GstVaapiDecoder *decoder,
|
||||
GstVaapiContextInfo *cip
|
||||
)
|
||||
gst_vaapi_decoder_ensure_context (GstVaapiDecoder * decoder,
|
||||
GstVaapiContextInfo * cip)
|
||||
{
|
||||
gst_vaapi_decoder_set_picture_size (decoder, cip->width, cip->height);
|
||||
|
||||
|
@ -957,8 +948,7 @@ gst_vaapi_decoder_ensure_context(
|
|||
if (decoder->context) {
|
||||
if (!gst_vaapi_context_reset (decoder->context, cip))
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
decoder->context = gst_vaapi_context_new (decoder->display, cip);
|
||||
if (!decoder->context)
|
||||
return FALSE;
|
||||
|
|
|
@ -123,7 +123,8 @@ gst_vaapi_decoder_parse(GstVaapiDecoder *decoder,
|
|||
guint * got_unit_size_ptr, gboolean * got_frame_ptr);
|
||||
|
||||
GstVaapiDecoderStatus
|
||||
gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame);
|
||||
gst_vaapi_decoder_decode (GstVaapiDecoder * decoder,
|
||||
GstVideoCodecFrame * frame);
|
||||
|
||||
GstVaapiDecoderStatus
|
||||
gst_vaapi_decoder_flush (GstVaapiDecoder * decoder);
|
||||
|
|
|
@ -166,7 +166,8 @@ typedef enum {
|
|||
} GstVaapiDecoderStatusPrivate;
|
||||
|
||||
typedef struct _GstVaapiParserState GstVaapiParserState;
|
||||
struct _GstVaapiParserState {
|
||||
struct _GstVaapiParserState
|
||||
{
|
||||
GstVideoCodecFrame *current_frame;
|
||||
guint32 current_frame_number;
|
||||
GstAdapter *current_adapter;
|
||||
|
@ -184,7 +185,8 @@ struct _GstVaapiParserState {
|
|||
*
|
||||
* A VA decoder base instance.
|
||||
*/
|
||||
struct _GstVaapiDecoder {
|
||||
struct _GstVaapiDecoder
|
||||
{
|
||||
/*< private >*/
|
||||
GstVaapiMiniObject parent_instance;
|
||||
|
||||
|
@ -207,7 +209,8 @@ struct _GstVaapiDecoder {
|
|||
*
|
||||
* A VA decoder base class.
|
||||
*/
|
||||
struct _GstVaapiDecoderClass {
|
||||
struct _GstVaapiDecoderClass
|
||||
{
|
||||
/*< private >*/
|
||||
GstVaapiMiniObjectClass parent_class;
|
||||
|
||||
|
@ -237,27 +240,18 @@ gst_vaapi_decoder_finalize(GstVaapiDecoder *decoder);
|
|||
|
||||
G_GNUC_INTERNAL
|
||||
void
|
||||
gst_vaapi_decoder_set_picture_size(
|
||||
GstVaapiDecoder *decoder,
|
||||
guint width,
|
||||
guint height
|
||||
);
|
||||
gst_vaapi_decoder_set_picture_size (GstVaapiDecoder * decoder,
|
||||
guint width, guint height);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
void
|
||||
gst_vaapi_decoder_set_framerate(
|
||||
GstVaapiDecoder *decoder,
|
||||
guint fps_n,
|
||||
guint fps_d
|
||||
);
|
||||
gst_vaapi_decoder_set_framerate (GstVaapiDecoder * decoder,
|
||||
guint fps_n, guint fps_d);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
void
|
||||
gst_vaapi_decoder_set_pixel_aspect_ratio(
|
||||
GstVaapiDecoder *decoder,
|
||||
guint par_n,
|
||||
guint par_d
|
||||
);
|
||||
gst_vaapi_decoder_set_pixel_aspect_ratio (GstVaapiDecoder * decoder,
|
||||
guint par_n, guint par_d);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
void
|
||||
|
@ -266,14 +260,13 @@ gst_vaapi_decoder_set_interlace_mode(GstVaapiDecoder *decoder,
|
|||
|
||||
G_GNUC_INTERNAL
|
||||
void
|
||||
gst_vaapi_decoder_set_interlaced(GstVaapiDecoder *decoder, gboolean interlaced);
|
||||
gst_vaapi_decoder_set_interlaced (GstVaapiDecoder * decoder,
|
||||
gboolean interlaced);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
gboolean
|
||||
gst_vaapi_decoder_ensure_context(
|
||||
GstVaapiDecoder *decoder,
|
||||
GstVaapiContextInfo *cip
|
||||
);
|
||||
gst_vaapi_decoder_ensure_context (GstVaapiDecoder * decoder,
|
||||
GstVaapiContextInfo * cip);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue