~ben-sput/+junk/libwaveplot

« back to all changes in this revision

Viewing changes to src/file.h

  • Committer: Ben Ockmore
  • Date: 2014-08-13 17:05:35 UTC
  • Revision ID: ben.sput@gmail.com-20140813170535-wn2vm73f8h08t6tn
Tags: upstream-0.0
ImportĀ upstreamĀ versionĀ 0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2014 Ben Ockmore
 
3
 *
 
4
 * This file is part of libwaveplot.
 
5
 
 
6
 * libwaveplot is free software: you can redistribute it and/or modify it under
 
7
 * the terms of the GNU Lesser General Public License as published by the Free
 
8
 * Software Foundation, either version 3 of the License, or (at your option)
 
9
 * any later version.
 
10
 
 
11
 * libwaveplot is distributed in the hope that it will be useful, but WITHOUT
 
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 
14
 * for more details.
 
15
 
 
16
 * You should have received a copy of the GNU Lesser General Public License
 
17
 * along with libwaveplot. If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifndef __LIBWP_FILE_H__
 
21
#define __LIBWP_FILE_H__
 
22
 
 
23
#include "libavcodec/avcodec.h"
 
24
#include "libavformat/avformat.h"
 
25
#include "libavresample/avresample.h"
 
26
 
 
27
#include "dllexport.h"
 
28
#include "typedefs.h"
 
29
 
 
30
struct file_t_t
 
31
{
 
32
        char* path;
 
33
 
 
34
        AVStream* stream;
 
35
        AVCodecContext* codec_context;
 
36
        AVCodec* codec;
 
37
        AVFormatContext* format_context;
 
38
        AVAudioResampleContext* resample_context;
 
39
 
 
40
};
 
41
 
 
42
/* Initialize WavePlot and libav */
 
43
LIBWAVEPLOT_API void init(void);
 
44
 
 
45
/* Allocate storage for a file structure, and deallocate. */
 
46
LIBWAVEPLOT_API file_t* alloc_file(void);
 
47
LIBWAVEPLOT_API void free_file(file_t*);
 
48
 
 
49
/* Load a file with libav, into an allocated file structure. */
 
50
LIBWAVEPLOT_API int load_file(char*, file_t*);
 
51
 
 
52
#endif //__LIBWP_FILE_H__