FFmpeg
avtextwriters.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) The FFmpeg developers
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg 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 GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef FFTOOLS_TEXTFORMAT_AVTEXTWRITERS_H
22 #define FFTOOLS_TEXTFORMAT_AVTEXTWRITERS_H
23 
24 #include <stddef.h>
25 #include <stdint.h>
26 #include "libavutil/attributes.h"
27 #include "libavutil/dict.h"
28 #include "libavformat/avio.h"
29 #include "libavutil/bprint.h"
30 #include "libavutil/rational.h"
31 #include "libavutil/hash.h"
32 
34 
35 typedef struct AVTextWriter {
36  const AVClass *priv_class; ///< private class of the writer, if any
37  int priv_size; ///< private size for the writer private class
38  const char *name;
39 
40  int (* init)(AVTextWriterContext *wctx);
41  void (* uninit)(AVTextWriterContext *wctx);
42  void (* writer_w8)(AVTextWriterContext *wctx, int b);
43  void (* writer_put_str)(AVTextWriterContext *wctx, const char *str);
44  void (* writer_printf)(AVTextWriterContext *wctx, const char *fmt, ...);
45 } AVTextWriter;
46 
47 typedef struct AVTextWriterContext {
48  const AVClass *class; ///< class of the writer
50  const char *name;
51  void *priv; ///< private data for use by the writer
52 
54 
55 
57 
59 
61 
62 int avtextwriter_create_avio(AVTextWriterContext **pwctx, AVIOContext *avio_ctx, int close_on_uninit);
63 
64 int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename, int close_on_uninit);
65 
67 
68 #endif /* FFTOOLS_TEXTFORMAT_AVTEXTWRITERS_H */
AVTextWriter::init
int(* init)(AVTextWriterContext *wctx)
Definition: avtextwriters.h:40
avtextwriter_create_stdout
int avtextwriter_create_stdout(AVTextWriterContext **pwctx)
Definition: tw_stdout.c:75
avtextwriter_create_avio
int avtextwriter_create_avio(AVTextWriterContext **pwctx, AVIOContext *avio_ctx, int close_on_uninit)
Definition: tw_avio.c:115
AVTextWriter::priv_size
int priv_size
private size for the writer private class
Definition: avtextwriters.h:37
rational.h
b
#define b
Definition: input.c:42
AVTextWriterContext
Definition: avtextwriters.h:47
AVTextWriterContext::priv
void * priv
private data for use by the writer
Definition: avtextwriters.h:51
output_filename
static const char * output_filename
Definition: ffprobe.c:329
avtextwriter_context_close
int avtextwriter_context_close(AVTextWriterContext **pwctx)
Definition: avtextformat.c:586
AVTextWriter::writer_put_str
void(* writer_put_str)(AVTextWriterContext *wctx, const char *str)
Definition: avtextwriters.h:43
avtextwriter_create_buffer
int avtextwriter_create_buffer(AVTextWriterContext **pwctx, AVBPrint *buffer)
Definition: tw_buffer.c:79
AVTextWriter::priv_class
const AVClass * priv_class
private class of the writer, if any
Definition: avtextwriters.h:36
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
AVTextWriter::writer_printf
void(* writer_printf)(AVTextWriterContext *wctx, const char *fmt,...)
Definition: avtextwriters.h:44
AVTextWriter::name
const char * name
Definition: avtextwriters.h:38
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
AVTextWriter
Definition: avtextwriters.h:35
AVTextWriterContext::writer
const AVTextWriter * writer
Definition: avtextwriters.h:49
avio.h
attributes.h
bprint.h
AVTextWriter::uninit
void(* uninit)(AVTextWriterContext *wctx)
Definition: avtextwriters.h:41
avtextwriter_context_open
int avtextwriter_context_open(AVTextWriterContext **pwctx, const AVTextWriter *writer)
Definition: avtextformat.c:604
dict.h
AVTextWriter::writer_w8
void(* writer_w8)(AVTextWriterContext *wctx, int b)
Definition: avtextwriters.h:42
hash.h
buffer
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
Definition: filter_design.txt:49
avtextwriter_create_file
int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename, int close_on_uninit)
Definition: tw_avio.c:90
AVTextWriterContext::name
const char * name
Definition: avtextwriters.h:50