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>
|
2022-02-07 05:49:27 +00:00
|
|
|
|
2008-02-26 20:53:18 +00:00
|
|
|
#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
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
@interface FFMPEGDecoder : NSObject <CogDecoder> {
|
|
|
|
id<CogSource> source;
|
|
|
|
BOOL seekable;
|
|
|
|
int channels;
|
2022-02-07 10:06:51 +00:00
|
|
|
uint32_t channelConfig;
|
2022-02-07 05:49:27 +00:00
|
|
|
int bitsPerSample;
|
|
|
|
BOOL floatingPoint;
|
|
|
|
BOOL lossy;
|
|
|
|
float frequency;
|
|
|
|
long totalFrames;
|
|
|
|
long framesRead;
|
|
|
|
int bitrate;
|
|
|
|
|
|
|
|
@private
|
|
|
|
unsigned char *buffer;
|
|
|
|
AVIOContext *ioCtx;
|
|
|
|
int streamIndex;
|
|
|
|
AVFormatContext *formatCtx;
|
|
|
|
AVCodecContext *codecCtx;
|
|
|
|
AVFrame *lastDecodedFrame;
|
|
|
|
AVPacket *lastReadPacket;
|
2022-02-10 08:32:24 +00:00
|
|
|
|
|
|
|
BOOL rawDSD;
|
|
|
|
BOOL rawDSDReverseBits;
|
|
|
|
BOOL rawDSDPlanar;
|
|
|
|
|
2022-02-07 05:49:27 +00:00
|
|
|
int bytesConsumedFromDecodedFrame;
|
|
|
|
BOOL readNextPacket;
|
|
|
|
int64_t seekFrame;
|
|
|
|
int64_t skipSamples;
|
|
|
|
BOOL endOfStream;
|
|
|
|
BOOL endOfAudio;
|
2022-02-09 05:33:56 +00:00
|
|
|
|
|
|
|
int metadataIndex;
|
2022-02-09 21:44:50 +00:00
|
|
|
NSString *genre;
|
2022-02-09 05:33:56 +00:00
|
|
|
NSString *artist;
|
|
|
|
NSString *title;
|
|
|
|
NSString *album;
|
|
|
|
NSDictionary *id3Metadata;
|
2008-02-26 20:53:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|