Home | History | Annotate | Download | only in src
      1 /*
      2  INTEL CONFIDENTIAL
      3  Copyright 2009 Intel Corporation All Rights Reserved.
      4  The source code contained or described herein and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers and licensors. The Material contains trade secrets and proprietary and confidential information of Intel or its suppliers and licensors. The Material is protected by worldwide copyright and trade secret laws and treaty provisions. No part of the Material may be used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, or disclosed in any way without Intels prior express written permission.
      5 
      6  No license under any patent, copyright, trade secret or other intellectual property right is granted to or conferred upon you by disclosure or delivery of the Materials, either expressly, by implication, inducement, estoppel or otherwise. Any license under such intellectual property rights must be express and approved by Intel in writing.
      7  */
      8 
      9 #ifndef __MIX_VIDEOFORMAT_VC1_H__
     10 #define __MIX_VIDEOFORMAT_VC1_H__
     11 
     12 #include "mixvideoformat.h"
     13 #include "mixvideoframe_private.h"
     14 
     15 //Note: this is only a max limit.  Actual number of surfaces allocated is calculated in mix_videoformat_vc1_initialize()
     16 #define MIX_VIDEO_VC1_SURFACE_NUM	8
     17 
     18 /*
     19  * Type macros.
     20  */
     21 #define MIX_TYPE_VIDEOFORMAT_VC1                  (mix_videoformat_vc1_get_type ())
     22 #define MIX_VIDEOFORMAT_VC1(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIX_TYPE_VIDEOFORMAT_VC1, MixVideoFormat_VC1))
     23 #define MIX_IS_VIDEOFORMAT_VC1(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIX_TYPE_VIDEOFORMAT_VC1))
     24 #define MIX_VIDEOFORMAT_VC1_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), MIX_TYPE_VIDEOFORMAT_VC1, MixVideoFormat_VC1Class))
     25 #define MIX_IS_VIDEOFORMAT_VC1_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), MIX_TYPE_VIDEOFORMAT_VC1))
     26 #define MIX_VIDEOFORMAT_VC1_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), MIX_TYPE_VIDEOFORMAT_VC1, MixVideoFormat_VC1Class))
     27 
     28 typedef struct _MixVideoFormat_VC1 MixVideoFormat_VC1;
     29 typedef struct _MixVideoFormat_VC1Class MixVideoFormat_VC1Class;
     30 
     31 struct _MixVideoFormat_VC1 {
     32 	/*< public > */
     33 	MixVideoFormat parent;
     34 
     35 	/*< public > */
     36 
     37 	/*< private > */
     38 	MixVideoFrame * reference_frames[2];
     39 	gboolean haveBframes;
     40 	gboolean loopFilter;
     41 	MixVideoFrame * lastFrame;
     42 };
     43 
     44 /**
     45  * MixVideoFormat_VC1Class:
     46  *
     47  * MI-X Video object class
     48  */
     49 struct _MixVideoFormat_VC1Class {
     50 	/*< public > */
     51 	MixVideoFormatClass parent_class;
     52 
     53 	/* class members */
     54 
     55 	/*< public > */
     56 };
     57 
     58 /**
     59  * mix_videoformat_vc1_get_type:
     60  * @returns: type
     61  *
     62  * Get the type of object.
     63  */
     64 GType mix_videoformat_vc1_get_type(void);
     65 
     66 /**
     67  * mix_videoformat_vc1_new:
     68  * @returns: A newly allocated instance of #MixVideoFormat_VC1
     69  *
     70  * Use this method to create new instance of #MixVideoFormat_VC1
     71  */
     72 MixVideoFormat_VC1 *mix_videoformat_vc1_new(void);
     73 
     74 /**
     75  * mix_videoformat_vc1_ref:
     76  * @mix: object to add reference
     77  * @returns: the MixVideoFormat_VC1 instance where reference count has been increased.
     78  *
     79  * Add reference count.
     80  */
     81 MixVideoFormat_VC1 *mix_videoformat_vc1_ref(MixVideoFormat_VC1 * mix);
     82 
     83 /**
     84  * mix_videoformat_vc1_unref:
     85  * @obj: object to unref.
     86  *
     87  * Decrement reference count of the object.
     88  */
     89 #define mix_videoformat_vc1_unref(obj) g_object_unref (G_OBJECT(obj))
     90 
     91 /* Class Methods */
     92 
     93 /* VC1 vmethods */
     94 MIX_RESULT mix_videofmt_vc1_getcaps(MixVideoFormat *mix, GString *msg);
     95 MIX_RESULT mix_videofmt_vc1_initialize(MixVideoFormat *mix,
     96                                   MixVideoConfigParamsDec * config_params,
     97                                   MixFrameManager * frame_mgr,
     98 				  MixBufferPool * input_buf_pool,
     99 				  MixSurfacePool ** surface_pool,
    100 				  VADisplay va_display);
    101 MIX_RESULT mix_videofmt_vc1_decode(MixVideoFormat *mix, MixBuffer * bufin[],
    102                 gint bufincnt, MixVideoDecodeParams * decode_params);
    103 MIX_RESULT mix_videofmt_vc1_flush(MixVideoFormat *mix);
    104 MIX_RESULT mix_videofmt_vc1_eos(MixVideoFormat *mix);
    105 MIX_RESULT mix_videofmt_vc1_deinitialize(MixVideoFormat *mix);
    106 
    107 /* Local Methods */
    108 
    109 MIX_RESULT mix_videofmt_vc1_handle_ref_frames(MixVideoFormat *mix,
    110                                         enum _picture_type frame_type,
    111                                         MixVideoFrame * current_frame);
    112 
    113 
    114 MIX_RESULT mix_videofmt_vc1_process_decode(MixVideoFormat *mix,
    115                                         vbp_data_vc1 *data,
    116 					guint64 timestamp,
    117 					gboolean discontinuity);
    118 
    119 
    120 MIX_RESULT mix_videofmt_vc1_release_input_buffers(MixVideoFormat *mix,
    121 					guint64 timestamp);
    122 
    123 #endif /* __MIX_VIDEOFORMAT_VC1_H__ */
    124