forked from samiamwork/Movist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MMovie_FFMPEG.h
112 lines (92 loc) · 2.67 KB
/
MMovie_FFMPEG.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//
// Movist
//
// Copyright 2006 ~ 2008 Yong-Hoe Kim, Cheol Ju. All rights reserved.
// Yong-Hoe Kim <cocoable@gmail.com>
// Cheol Ju <moosoy@gmail.com>
//
// This file is part of Movist.
//
// Movist is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Movist is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#import "MMovie.h"
#import <libavcodec/avcodec.h>
#import <libavformat/avformat.h>
enum {
COMMAND_NONE,
COMMAND_STEP_BACKWARD,
COMMAND_STEP_FORWARD,
COMMAND_SEEK,
COMMAND_PLAY,
COMMAND_PAUSE,
};
@class FFTrack;
@class FFVideoTrack;
@class FFAudioTrack;
@class FFIndexer;
@interface MMovie_FFmpeg : MMovie
{
AVFormatContext* _formatContext;
FFVideoTrack* _mainVideoTrack;
FFAudioTrack* _mainAudioTrack;
FFIndexer* _indexer;
// playback: control
int _command;
int _reservedCommand;
NSConditionLock* _commandLock;
BOOL _playLocked;
NSLock* _frameReadMutex;
NSLock* _trackMutex;
BOOL _running;
BOOL _quitRequested;
BOOL _dispatchNextImage;
BOOL _dispatchPacket;
BOOL _seekComplete;
BOOL _fileEnded;
BOOL _movieEndNotificationPosted;
// playback: play
float _rate;
BOOL _playAfterSeek; // for continuous play after seek
double _frameInterval;
BOOL _useFrameDrop;
// playback: seek
float _seekTime;
float _reservedSeekTime;
double _lastDecodedTime;
double _currentTime;
double _hostTimeFreq;
double _hostTime;
double _hostTime0point;
double _avFineTuningTime;
}
+ (NSString*)name;
- (BOOL)initAVCodec:(int*)errorCode digitalAudioOut:(BOOL)digitalAudioOut;
- (void)cleanupAVCodec;
@end
////////////////////////////////////////////////////////////////////////////////
#pragma mark -
@interface MMovie_FFmpeg (Playback)
- (BOOL)initPlayback:(int*)errorCode;
- (void)cleanupPlayback;
- (int)command;
- (int)reservedCommand;
- (BOOL)isPlayLocked;
- (BOOL)isRunning;
- (BOOL)quitRequested;
- (double)hostTimeFreq;
- (double)hostTime0point;
- (BOOL)canDecodeVideo;
- (void)videoTrack:(FFVideoTrack*)videoTrack decodedTime:(double)time;
- (void)audioTrack:(FFAudioTrack*)audioTrack avFineTuningTime:(double)time;
@end