blob: 4be322a33f6e01cb951033ccca0730b8caa202af [file] [log] [blame]
/*
INTEL CONFIDENTIAL
Copyright 2009 Intel Corporation All Rights Reserved.
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 Intel’s prior express written permission.
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.
*/
#ifndef __MIX_FRAMEMANAGER_H__
#define __MIX_FRAMEMANAGER_H__
#include <glib-object.h>
#include "mixvideodef.h"
#include "mixvideoframe.h"
#include "mixvideothread.h"
/*
* MIX_FRAMEORDER_MODE_DECODEORDER is here interpreted as
* MIX_DISPLAY_ORDER_FIFO, a special case of display order mode.
*/
typedef enum
{
MIX_DISPLAY_ORDER_UNKNOWN,
MIX_DISPLAY_ORDER_FIFO,
MIX_DISPLAY_ORDER_TIMESTAMP,
MIX_DISPLAY_ORDER_PICNUMBER,
MIX_DISPLAY_ORDER_PICTYPE,
MIX_DISPLAY_ORDER_LAST
} MixDisplayOrderMode;
class MixFrameManager {
/*< private > */
public:
gboolean initialized;
gboolean flushing;
gboolean eos;
MixVideoMutex mLock;
GSList* frame_list;
gint framerate_numerator;
gint framerate_denominator;
guint64 frame_timestamp_delta;
MixDisplayOrderMode mode;
gboolean is_first_frame;
guint64 last_frame_timestamp;
guint64 next_frame_timestamp;
guint32 next_frame_picnumber;
gint max_enqueue_size;
guint32 max_picture_number;
guint32 ref_count;
public:
MixFrameManager();
~MixFrameManager();
};
/**
* mix_framemanager_new:
* @returns: A newly allocated instance of #MixFrameManager
*
* Use this method to create new instance of #MixFrameManager
*/
MixFrameManager *mix_framemanager_new(void);
/**
* mix_framemanager_ref:
* @mix: object to add reference
* @returns: the MixFrameManager instance where reference count has been increased.
*
* Add reference count.
*/
MixFrameManager *mix_framemanager_ref(MixFrameManager * mix);
/**
* mix_framemanager_unref:
* @obj: object to unref.
*
* Decrement reference count of the object.
*/
MixFrameManager* mix_framemanager_unref(MixFrameManager* fm);
/* Class Methods */
/*
* Initialize FM
*/
MIX_RESULT mix_framemanager_initialize(MixFrameManager *fm,
MixDisplayOrderMode mode, gint framerate_numerator,
gint framerate_denominator);
/*
* Deinitialize FM
*/
MIX_RESULT mix_framemanager_deinitialize(MixFrameManager *fm);
/*
* Set new framerate
*/
MIX_RESULT mix_framemanager_set_framerate(MixFrameManager *fm,
gint framerate_numerator, gint framerate_denominator);
/*
* Get framerate
*/
MIX_RESULT mix_framemanager_get_framerate(MixFrameManager *fm,
gint *framerate_numerator, gint *framerate_denominator);
/*
* Set miximum size of queue
*/
MIX_RESULT mix_framemanager_set_max_enqueue_size(MixFrameManager *fm, gint size);
/*
* Set miximum picture number
*/
MIX_RESULT mix_framemanager_set_max_picture_number(MixFrameManager *fm, guint32 num);
/*
* Get Display Order Mode
*/
MIX_RESULT mix_framemanager_get_display_order_mode(MixFrameManager *fm,
MixDisplayOrderMode *mode);
/*
* For discontiunity, reset FM
*/
MIX_RESULT mix_framemanager_flush(MixFrameManager *fm);
/*
* Enqueue MixVideoFrame
*/
MIX_RESULT mix_framemanager_enqueue(MixFrameManager *fm, MixVideoFrame *mvf);
/*
* Dequeue MixVideoFrame in proper order depends on MixDisplayOrderMode value
* during initialization.
*/
MIX_RESULT mix_framemanager_dequeue(MixFrameManager *fm, MixVideoFrame **mvf);
/*
* End of stream.
*/
MIX_RESULT mix_framemanager_eos(MixFrameManager *fm);
#endif /* __MIX_FRAMEMANAGER_H__ */