PageRenderTime 31ms CodeModel.GetById 15ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/libavcodec/libdirac_libschro.h

http://github.com/FFmpeg/FFmpeg
C++ Header | 105 lines | 31 code | 16 blank | 58 comment | 0 complexity | 071a1ea565c1cbdb618128cb6e217f45 MD5 | raw file
  1/*
  2 * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
  3 *
  4 * This file is part of FFmpeg.
  5 *
  6 * FFmpeg is free software; you can redistribute it and/or
  7 * modify it under the terms of the GNU Lesser General Public
  8 * License as published by the Free Software Foundation; either
  9 * version 2.1 of the License, or (at your option) any later version.
 10 *
 11 * FFmpeg is distributed in the hope that it will be useful,
 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14 * Lesser General Public License for more details.
 15 *
 16 * You should have received a copy of the GNU Lesser General Public
 17 * License along with FFmpeg; if not, write to the Free Software
 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 19 */
 20
 21/**
 22* @file
 23* data structures common to libdirac and libschroedinger
 24*/
 25
 26#ifndef AVCODEC_LIBDIRAC_LIBSCHRO_H
 27#define AVCODEC_LIBDIRAC_LIBSCHRO_H
 28
 29#include "avcodec.h"
 30
 31typedef struct {
 32    uint16_t width;
 33    uint16_t height;
 34    uint16_t frame_rate_num;
 35    uint16_t frame_rate_denom;
 36} DiracSchroVideoFormatInfo;
 37
 38/**
 39* Returns the index into the Dirac Schro common video format info table
 40*/
 41unsigned int ff_dirac_schro_get_video_format_idx(AVCodecContext *avccontext);
 42
 43/**
 44* contains a single encoded frame returned from Dirac or Schroedinger
 45*/
 46typedef struct DiracSchroEncodedFrame {
 47    /** encoded frame data */
 48    uint8_t *p_encbuf;
 49
 50    /** encoded frame size */
 51    uint32_t size;
 52
 53    /** encoded frame number. Will be used as pts */
 54    uint32_t frame_num;
 55
 56    /** key frame flag. 1 : is key frame , 0 : in not key frame */
 57    uint16_t key_frame;
 58} DiracSchroEncodedFrame;
 59
 60/**
 61* queue element
 62*/
 63typedef struct DiracSchroQueueElement {
 64    /** Data to be stored in queue*/
 65    void *data;
 66    /** Pointer to next element queue */
 67    struct DiracSchroQueueElement *next;
 68} DiracSchroQueueElement;
 69
 70
 71/**
 72* A simple queue implementation used in libdirac and libschroedinger
 73*/
 74typedef struct DiracSchroQueue {
 75    /** Pointer to head of queue */
 76    DiracSchroQueueElement *p_head;
 77    /** Pointer to tail of queue */
 78    DiracSchroQueueElement *p_tail;
 79    /** Queue size*/
 80    int size;
 81} DiracSchroQueue;
 82
 83/**
 84* Initialise the queue
 85*/
 86void ff_dirac_schro_queue_init(DiracSchroQueue *queue);
 87
 88/**
 89* Add an element to the end of the queue
 90*/
 91int ff_dirac_schro_queue_push_back(DiracSchroQueue *queue, void *p_data);
 92
 93/**
 94* Return the first element in the queue
 95*/
 96void *ff_dirac_schro_queue_pop(DiracSchroQueue *queue);
 97
 98/**
 99* Free the queue resources. free_func is a function supplied by the caller to
100* free any resources allocated by the caller. The data field of the queue
101* element is passed to it.
102*/
103void ff_dirac_schro_queue_free(DiracSchroQueue *queue,
104                               void (*free_func)(void *));
105#endif /* AVCODEC_LIBDIRAC_LIBSCHRO_H */