Blame ext/vpx/gstvpxdec.h

Packit 8ff292
/* VPX
Packit 8ff292
 * Copyright (C) 2006 David Schleef <ds@schleef.org>
Packit 8ff292
 * Copyright (C) 2008,2009,2010 Entropy Wave Inc
Packit 8ff292
 * Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
Packit 8ff292
 *
Packit 8ff292
 * This library is free software; you can redistribute it and/or
Packit 8ff292
 * modify it under the terms of the GNU Library General Public
Packit 8ff292
 * License as published by the Free Software Foundation; either
Packit 8ff292
 * version 2 of the License, or (at your option) any later version.
Packit 8ff292
 *
Packit 8ff292
 * This library is distributed in the hope that it will be useful,
Packit 8ff292
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8ff292
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 8ff292
 * Library General Public License for more details.
Packit 8ff292
 *
Packit 8ff292
 * You should have received a copy of the GNU Library General Public
Packit 8ff292
 * License along with this library; if not, write to the
Packit 8ff292
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 8ff292
 * Boston, MA 02110-1301, USA.
Packit 8ff292
 *
Packit 8ff292
 */
Packit 8ff292
Packit 8ff292
#ifndef __GST_VPX_DEC_H__
Packit 8ff292
#define __GST_VPX_DEC_H__
Packit 8ff292
Packit 8ff292
#ifdef HAVE_CONFIG_H
Packit 8ff292
#include "config.h"
Packit 8ff292
#endif
Packit 8ff292
Packit 8ff292
#if defined(HAVE_VP8_DECODER) || defined(HAVE_VP9_DECODER)
Packit 8ff292
Packit 8ff292
#include <gst/gst.h>
Packit 8ff292
#include <gst/video/gstvideodecoder.h>
Packit 8ff292
Packit 8ff292
/* FIXME: Undef HAVE_CONFIG_H because vpx_codec.h uses it,
Packit 8ff292
 * which causes compilation failures */
Packit 8ff292
#ifdef HAVE_CONFIG_H
Packit 8ff292
#undef HAVE_CONFIG_H
Packit 8ff292
#endif
Packit 8ff292
Packit 8ff292
#include <vpx/vpx_decoder.h>
Packit 8ff292
#include <vpx/vp8dx.h>
Packit 8ff292
Packit 8ff292
G_BEGIN_DECLS
Packit 8ff292
Packit 8ff292
#define GST_TYPE_VPX_DEC \
Packit 8ff292
  (gst_vpx_dec_get_type())
Packit 8ff292
#define GST_VPX_DEC(obj) \
Packit 8ff292
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VPX_DEC,GstVPXDec))
Packit 8ff292
#define GST_VPX_DEC_CLASS(klass) \
Packit 8ff292
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VPX_DEC,GstVPXDecClass))
Packit 8ff292
#define GST_IS_VPX_DEC(obj) \
Packit 8ff292
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VPX_DEC))
Packit 8ff292
#define GST_IS_VPX_DEC_CLASS(obj) \
Packit 8ff292
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VPX_DEC))
Packit 8ff292
#define GST_VPX_DEC_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VPX_DEC, GstVPXDecClass))
Packit 8ff292
Packit 8ff292
typedef struct _GstVPXDec GstVPXDec;
Packit 8ff292
typedef struct _GstVPXDecClass GstVPXDecClass;
Packit 8ff292
Packit 8ff292
struct _GstVPXDec
Packit 8ff292
{
Packit 8ff292
  GstVideoDecoder base_video_decoder;
Packit 8ff292
Packit 8ff292
  /* < private > */
Packit 8ff292
  vpx_codec_ctx_t decoder;
Packit 8ff292
Packit 8ff292
  /* state */
Packit 8ff292
  gboolean decoder_inited;
Packit 8ff292
Packit 8ff292
  /* properties */
Packit 8ff292
  gboolean post_processing;
Packit 8ff292
  enum vp8_postproc_level post_processing_flags;
Packit 8ff292
  gint deblocking_level;
Packit 8ff292
  gint noise_level;
Packit 8ff292
  gint threads;
Packit 8ff292
Packit 8ff292
  GstVideoCodecState *input_state;
Packit 8ff292
  GstVideoCodecState *output_state;
Packit 8ff292
Packit 8ff292
  /* allocation */
Packit 8ff292
  gboolean have_video_meta;
Packit 8ff292
  GstBufferPool *pool;
Packit 8ff292
  gsize buf_size;
Packit 8ff292
};
Packit 8ff292
Packit 8ff292
struct _GstVPXDecClass
Packit 8ff292
{
Packit 8ff292
  GstVideoDecoderClass base_video_decoder_class;
Packit 8ff292
  const char* video_codec_tag;
Packit 8ff292
  /*supported vpx algo*/
Packit 8ff292
  vpx_codec_iface_t* codec_algo;
Packit 8ff292
  /*virtual function to open_codec*/
Packit 8ff292
  GstFlowReturn (*open_codec) (GstVPXDec * dec, GstVideoCodecFrame * frame);
Packit 8ff292
  /*virtual function to send tags*/
Packit 8ff292
  void (*send_tags) (GstVPXDec* dec);
Packit 8ff292
  /*virtual function to set/correct the stream info*/
Packit 8ff292
  void (*set_stream_info) (GstVPXDec *dec, vpx_codec_stream_info_t *stream_info);
Packit 8ff292
  /*virtual function to set default format while opening codec*/
Packit 8ff292
  void (*set_default_format) (GstVPXDec *dec, GstVideoFormat fmt, int width, int height);
Packit 8ff292
  /*virtual function to negotiate format while handling frame*/
Packit 8ff292
  void (*handle_resolution_change) (GstVPXDec *dec, vpx_image_t *img, GstVideoFormat fmt);
Packit 8ff292
  /*virtual function to check valid format*/
Packit 8ff292
  gboolean (*get_frame_format)(GstVPXDec *dec, vpx_image_t *img, GstVideoFormat* fmt);
Packit 8ff292
};
Packit 8ff292
Packit 8ff292
GType gst_vpx_dec_get_type (void);
Packit 8ff292
Packit 8ff292
G_END_DECLS
Packit 8ff292
Packit 8ff292
#endif
Packit 8ff292
Packit 8ff292
#endif /* __GST_VP8_DEC_H__ */