~akirad/cinecutie/trunk

« back to all changes in this revision

Viewing changes to cinecutie/fileffmpeg.h

  • Committer: Paolo Rampino
  • Date: 2010-02-25 07:51:52 UTC
  • Revision ID: git-v1:c74603cb54533bbef44afb18f7f983887e339605
added support for wmv flv and many other format

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * CINELERRA
 
4
 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
 
5
 * 
 
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.
 
10
 * 
 
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.
 
15
 * 
 
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
 
19
 * 
 
20
 */
 
21
 
 
22
#ifndef FILEFFMPEG_H
 
23
#define FILEFFMPEG_H
 
24
 
 
25
 
 
26
#include "asset.inc" 
 
27
#include "filebase.h"
 
28
#include "file.inc"
 
29
#include "mutex.inc"
 
30
 
 
31
 
 
32
// Decoding for all FFMPEG formats
 
33
 
 
34
 
 
35
class FileFFMPEG : public FileBase
 
36
{
 
37
public:
 
38
        FileFFMPEG(Asset *asset, File *file);
 
39
        ~FileFFMPEG();
 
40
 
 
41
// Get format string for ffmpeg
 
42
        static char* get_format_string(Asset *asset);
 
43
        static int check_sig(Asset *asset);
 
44
        void reset();
 
45
        int open_file(int rd, int wr);
 
46
        int close_file();
 
47
 
 
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);
 
53
 
 
54
        void dump_context(void *ptr);
 
55
        void *ffmpeg_format;
 
56
        void *ffmpeg_file_context;
 
57
        void *ffmpeg_frame;
 
58
        short *ffmpeg_samples;
 
59
 
 
60
// Streams to decode
 
61
        int audio_index;
 
62
        int video_index;
 
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;
 
70
        int first_frame;
 
71
};
 
72
 
 
73
 
 
74
 
 
75
 
 
76
 
 
77
#endif