| 1 | /* |
|---|
| 2 | * FrameBuffer.h |
|---|
| 3 | * Created by Graham Booker on 1/30/07. |
|---|
| 4 | * |
|---|
| 5 | * This file is part of Perian. |
|---|
| 6 | * |
|---|
| 7 | * This library is free software; you can redistribute it and/or |
|---|
| 8 | * modify it under the terms of the GNU Lesser General Public |
|---|
| 9 | * License as published by the Free Software Foundation; either |
|---|
| 10 | * version 2.1 of the License, or (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This library is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 | * Lesser General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU Lesser General Public |
|---|
| 18 | * License along with FFmpeg; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | typedef struct FrameData_s FrameData; |
|---|
| 23 | typedef struct FFusionData_s FFusionData; |
|---|
| 24 | |
|---|
| 25 | struct FrameData_s |
|---|
| 26 | { |
|---|
| 27 | uint8_t *buffer; |
|---|
| 28 | unsigned int dataSize; |
|---|
| 29 | long frameNumber; |
|---|
| 30 | short type; |
|---|
| 31 | short skippabble; |
|---|
| 32 | short decoded; |
|---|
| 33 | FrameData *prereqFrame; /* This is the frame's data which must be decoded to fully display this frame */ |
|---|
| 34 | FrameData *nextFrame; /* This is the next frame to decode if this one is already decoded. This is for predictive decoding */ |
|---|
| 35 | FFusionData *data; |
|---|
| 36 | }; |
|---|
| 37 | |
|---|
| 38 | typedef struct DataRingBuffer_s { |
|---|
| 39 | } DataRingBuffer; |
|---|
| 40 | |
|---|
| 41 | struct FFusionData_s |
|---|
| 42 | { |
|---|
| 43 | FrameData unparsedFrames; |
|---|
| 44 | /* private */ |
|---|
| 45 | unsigned int frameSize; |
|---|
| 46 | unsigned int frameRead; |
|---|
| 47 | unsigned int frameWrite; |
|---|
| 48 | FrameData *frames; |
|---|
| 49 | unsigned int ringSize; |
|---|
| 50 | unsigned int ringRead; |
|---|
| 51 | unsigned int ringWrite; |
|---|
| 52 | uint8_t *ringBuffer; |
|---|
| 53 | FFusionData *previousData; |
|---|
| 54 | }; |
|---|
| 55 | |
|---|
| 56 | void FFusionDataSetup(FFusionData *data, int dataSize, int bufferSize); |
|---|
| 57 | void FFusionDataFree(FFusionData *data); |
|---|
| 58 | uint8_t *FFusionCreateEntireDataBuffer(FFusionData *data, uint8_t *buffer, int bufferSize); |
|---|
| 59 | FrameData *FFusionDataAppend(FFusionData *data, uint8_t *buffer, int dataSize, int type); |
|---|
| 60 | void FFusionDataSetUnparsed(FFusionData *data, uint8_t *buffer, int bufferSize); |
|---|
| 61 | void FFusionDataMarkRead(FrameData *toData); |
|---|
| 62 | FrameData *FFusionDataFind(FFusionData *data, int frameNumber); |
|---|
| 63 | |
|---|
| 64 | FrameData *FrameDataCheckPrereq(FrameData *toData); |
|---|