2008-04-22 16:22:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
|
|
|
|
*
|
2011-03-18 19:35:10 +02:00
|
|
|
* This file is part of Libav.
|
2008-04-22 16:22:21 +03:00
|
|
|
*
|
2011-03-18 19:35:10 +02:00
|
|
|
* Libav is free software; you can redistribute it and/or
|
2008-04-22 16:22:21 +03:00
|
|
|
* 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.
|
|
|
|
*
|
2011-03-18 19:35:10 +02:00
|
|
|
* Libav is distributed in the hope that it will be useful,
|
2008-04-22 16:22:21 +03:00
|
|
|
* 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
|
2011-03-18 19:35:10 +02:00
|
|
|
* License along with Libav; if not, write to the Free Software
|
2008-04-22 16:22:21 +03:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2010-04-20 17:45:34 +03:00
|
|
|
* @file
|
2008-04-22 16:22:21 +03:00
|
|
|
* data structures common to libdirac and libschroedinger
|
|
|
|
*/
|
|
|
|
|
2008-08-31 10:39:47 +03:00
|
|
|
#ifndef AVCODEC_LIBDIRAC_LIBSCHRO_H
|
|
|
|
#define AVCODEC_LIBDIRAC_LIBSCHRO_H
|
2008-04-22 16:22:21 +03:00
|
|
|
|
|
|
|
#include "avcodec.h"
|
|
|
|
|
2009-08-15 14:42:15 +03:00
|
|
|
typedef struct {
|
2008-04-22 16:22:21 +03:00
|
|
|
uint16_t width;
|
|
|
|
uint16_t height;
|
|
|
|
uint16_t frame_rate_num;
|
|
|
|
uint16_t frame_rate_denom;
|
|
|
|
} FfmpegDiracSchroVideoFormatInfo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the index into the Dirac Schro common video format info table
|
|
|
|
*/
|
2009-08-15 14:42:15 +03:00
|
|
|
unsigned int ff_dirac_schro_get_video_format_idx(AVCodecContext *avccontext);
|
2008-04-22 16:22:21 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* contains a single encoded frame returned from Dirac or Schroedinger
|
|
|
|
*/
|
2009-08-15 14:42:15 +03:00
|
|
|
typedef struct FfmpegDiracSchroEncodedFrame {
|
2008-04-22 16:22:21 +03: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;
|
|
|
|
} FfmpegDiracSchroEncodedFrame;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* queue element
|
|
|
|
*/
|
2009-08-15 14:42:15 +03:00
|
|
|
typedef struct FfmpegDiracSchroQueueElement {
|
2008-04-22 16:22:21 +03:00
|
|
|
/** Data to be stored in queue*/
|
|
|
|
void *data;
|
|
|
|
/** Pointer to next element queue */
|
|
|
|
struct FfmpegDiracSchroQueueElement *next;
|
|
|
|
} FfmpegDiracSchroQueueElement;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A simple queue implementation used in libdirac and libschroedinger
|
|
|
|
*/
|
2009-08-15 14:42:15 +03:00
|
|
|
typedef struct FfmpegDiracSchroQueue {
|
2008-04-22 16:22:21 +03:00
|
|
|
/** Pointer to head of queue */
|
|
|
|
FfmpegDiracSchroQueueElement *p_head;
|
|
|
|
/** Pointer to tail of queue */
|
|
|
|
FfmpegDiracSchroQueueElement *p_tail;
|
2008-07-10 14:40:19 +03:00
|
|
|
/** Queue size*/
|
|
|
|
int size;
|
2008-04-22 16:22:21 +03:00
|
|
|
} FfmpegDiracSchroQueue;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialise the queue
|
|
|
|
*/
|
|
|
|
void ff_dirac_schro_queue_init(FfmpegDiracSchroQueue *queue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an element to the end of the queue
|
|
|
|
*/
|
2009-08-15 14:42:15 +03:00
|
|
|
int ff_dirac_schro_queue_push_back(FfmpegDiracSchroQueue *queue, void *p_data);
|
2008-04-22 16:22:21 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the first element in the queue
|
|
|
|
*/
|
2009-08-15 14:42:15 +03:00
|
|
|
void *ff_dirac_schro_queue_pop(FfmpegDiracSchroQueue *queue);
|
2008-04-22 16:22:21 +03: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.
|
|
|
|
*/
|
|
|
|
void ff_dirac_schro_queue_free(FfmpegDiracSchroQueue *queue,
|
|
|
|
void (*free_func)(void *));
|
2008-08-31 10:39:47 +03:00
|
|
|
#endif /* AVCODEC_LIBDIRAC_LIBSCHRO_H */
|