2008-02-26 20:53:18 +00:00
|
|
|
//
|
2013-10-07 17:33:35 +00:00
|
|
|
// FFMPEGDecoder.h
|
|
|
|
// FFMPEG
|
2008-02-26 20:53:18 +00:00
|
|
|
//
|
|
|
|
// Created by Andre Reffhaug on 2/26/08.
|
|
|
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import "Plugin.h"
|
|
|
|
|
2016-05-07 06:35:04 +00:00
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
#include <libavformat/avformat.h>
|
2008-02-26 20:53:18 +00:00
|
|
|
|
2013-10-07 17:33:35 +00:00
|
|
|
@interface FFMPEGDecoder : NSObject <CogDecoder>
|
2008-02-28 05:33:56 +00:00
|
|
|
{
|
2016-07-15 16:26:18 +00:00
|
|
|
id<CogSource> source;
|
2013-10-11 03:55:32 +00:00
|
|
|
BOOL seekable;
|
|
|
|
int channels;
|
|
|
|
int bitsPerSample;
|
2013-10-05 21:15:09 +00:00
|
|
|
BOOL floatingPoint;
|
2013-10-11 03:55:32 +00:00
|
|
|
float frequency;
|
|
|
|
long totalFrames;
|
|
|
|
long framesRead;
|
|
|
|
int bitrate;
|
|
|
|
|
|
|
|
@private
|
2016-07-15 16:26:18 +00:00
|
|
|
unsigned char *buffer;
|
|
|
|
AVIOContext *ioCtx;
|
2013-10-11 03:55:32 +00:00
|
|
|
int streamIndex;
|
|
|
|
AVFormatContext *formatCtx;
|
|
|
|
AVCodecContext *codecCtx;
|
|
|
|
AVFrame *lastDecodedFrame;
|
|
|
|
AVPacket *lastReadPacket;
|
|
|
|
int bytesConsumedFromDecodedFrame;
|
|
|
|
BOOL readNextPacket;
|
2014-04-26 22:38:45 +00:00
|
|
|
BOOL endOfStream;
|
2016-07-16 04:41:23 +00:00
|
|
|
BOOL endOfAudio;
|
2008-02-26 20:53:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|