2008-04-22 13:22:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2010-04-20 14:45:34 +00:00
|
|
|
* @file
|
2008-04-22 13:22:21 +00:00
|
|
|
* data structures common to libdirac and libschroedinger
|
|
|
|
*/
|
|
|
|
|
2008-08-31 07:39:47 +00:00
|
|
|
#ifndef AVCODEC_LIBDIRAC_LIBSCHRO_H
|
|
|
|
#define AVCODEC_LIBDIRAC_LIBSCHRO_H
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
#include "avcodec.h"
|
|
|
|
|
2009-08-15 11:42:15 +00:00
|
|
|
typedef struct {
|
2008-04-22 13:22:21 +00:00
|
|
|
uint16_t width;
|
|
|
|
uint16_t height;
|
|
|
|
uint16_t frame_rate_num;
|
|
|
|
uint16_t frame_rate_denom;
|
2011-10-30 12:19:50 +00:00
|
|
|
} DiracSchroVideoFormatInfo;
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the index into the Dirac Schro common video format info table
|
|
|
|
*/
|
2009-08-15 11:42:15 +00:00
|
|
|
unsigned int ff_dirac_schro_get_video_format_idx(AVCodecContext *avccontext);
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* contains a single encoded frame returned from Dirac or Schroedinger
|
|
|
|
*/
|
2011-10-30 12:19:50 +00:00
|
|
|
typedef struct DiracSchroEncodedFrame {
|
2008-04-22 13:22:21 +00:00
|
|
|
/** encoded frame data */
|
|
|
|
uint8_t *p_encbuf;
|
|
|
|
|
|
|
|
/** encoded frame size */
|
|
|
|
uint32_t size;
|
|
|
|
|
|
|
|
/** encoded frame number. Will be used as pts */
|
|
|
|
uint32_t frame_num;
|
|
|
|
|
|
|
|
/** key frame flag. 1 : is key frame , 0 : in not key frame */
|
|
|
|
uint16_t key_frame;
|
2011-10-30 12:19:50 +00:00
|
|
|
} DiracSchroEncodedFrame;
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* queue element
|
|
|
|
*/
|
2011-10-30 12:19:50 +00:00
|
|
|
typedef struct DiracSchroQueueElement {
|
2008-04-22 13:22:21 +00:00
|
|
|
/** Data to be stored in queue*/
|
|
|
|
void *data;
|
|
|
|
/** Pointer to next element queue */
|
2011-10-30 12:19:50 +00:00
|
|
|
struct DiracSchroQueueElement *next;
|
|
|
|
} DiracSchroQueueElement;
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A simple queue implementation used in libdirac and libschroedinger
|
|
|
|
*/
|
2011-10-30 12:19:50 +00:00
|
|
|
typedef struct DiracSchroQueue {
|
2008-04-22 13:22:21 +00:00
|
|
|
/** Pointer to head of queue */
|
2011-10-30 12:19:50 +00:00
|
|
|
DiracSchroQueueElement *p_head;
|
2008-04-22 13:22:21 +00:00
|
|
|
/** Pointer to tail of queue */
|
2011-10-30 12:19:50 +00:00
|
|
|
DiracSchroQueueElement *p_tail;
|
2008-07-10 11:40:19 +00:00
|
|
|
/** Queue size*/
|
|
|
|
int size;
|
2011-10-30 12:19:50 +00:00
|
|
|
} DiracSchroQueue;
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialise the queue
|
|
|
|
*/
|
2011-10-30 12:19:50 +00:00
|
|
|
void ff_dirac_schro_queue_init(DiracSchroQueue *queue);
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an element to the end of the queue
|
|
|
|
*/
|
2011-10-30 12:19:50 +00:00
|
|
|
int ff_dirac_schro_queue_push_back(DiracSchroQueue *queue, void *p_data);
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the first element in the queue
|
|
|
|
*/
|
2011-10-30 12:19:50 +00:00
|
|
|
void *ff_dirac_schro_queue_pop(DiracSchroQueue *queue);
|
2008-04-22 13:22:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Free the queue resources. free_func is a function supplied by the caller to
|
|
|
|
* free any resources allocated by the caller. The data field of the queue
|
|
|
|
* element is passed to it.
|
|
|
|
*/
|
2011-10-30 12:19:50 +00:00
|
|
|
void ff_dirac_schro_queue_free(DiracSchroQueue *queue,
|
2008-04-22 13:22:21 +00:00
|
|
|
void (*free_func)(void *));
|
2008-08-31 07:39:47 +00:00
|
|
|
#endif /* AVCODEC_LIBDIRAC_LIBSCHRO_H */
|