4
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program 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
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
// Decoding for all FFMPEG formats
35
class FileFFMPEG : public FileBase
38
FileFFMPEG(Asset *asset, File *file);
41
// Get format string for ffmpeg
42
static char* get_format_string(Asset *asset);
43
static int check_sig(Asset *asset);
45
int open_file(int rd, int wr);
48
int64_t get_memory_usage();
49
int colormodel_supported(int colormodel);
50
int get_best_colormodel(Asset *asset, int driver);
51
int read_frame(VFrame *frame);
52
int read_samples(double *buffer, int64_t len);
54
void dump_context(void *ptr);
56
void *ffmpeg_file_context;
58
short *ffmpeg_samples;
63
// Next read positions
64
int64_t current_frame;
65
int64_t current_sample;
66
// Last decoded positions
67
int64_t decoded_frame;
68
int64_t decoded_sample;
69
static Mutex *ffmpeg_lock;