-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathavpipe.h
120 lines (110 loc) · 3.22 KB
/
avpipe.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
113
114
115
116
117
118
119
120
/*
* avpipe.h
*
* Defines all the interfaces available to the Go layer.
* There are two sets of API's available for transcoding/probing in this layer:
* - APIs with handle: these APIs allow the client application to cancel a transcoding if it is necessary.
* - xc_init(): to initialize a transcoding and obtain a handle.
* - xc_run(): to start a transcoding with obtained handle.
* - xc_cancel(): to cancel/stop a transcoding with specified handle.
* - APIs with no handle: these APIs are very simple to use and just need transcoding/probing params.
* - xc(): starts a transcoding with specified transcoding params.
* - mux(): starts a muxing job with specified params.
* - probe(): probs the specified stream/file.
*
* Other miscellaneous APIs are:
* - get_pix_fmt_name(): to obtain pixel format name.
* - get_profile_name(): to obtain profile name.
*/
#pragma once
#include "avpipe_xc.h"
/**
* @brief Initializes a transcoding context and returns its handle.
* The transcoding context is internal to the C/Go layer.
*
* @param params Transcoding parameters.
* @param handle Pointer to the handle of transcoding context.
*
* @return If it is successful it returns eav_success, otherwise corresponding error.
*/
int32_t
xc_init(
xcparams_t *params,
int32_t *handle);
/**
* @brief Starts the transcoding specified by handle.
*
* @param handle The handle of transcoding context that is obtained by xc_init().
* @return If it is successful it returns eav_success, otherwise corresponding error.
*/
int
xc_run(
int32_t handle);
/**
* @brief Cancels or stops the transcoding specified by handle.
*
* @param handle The handle of transcoding context that is obtained by xc_init().
* @return If it is successful it returns eav_success, otherwise eav_xc_table.
*/
int
xc_cancel(
int32_t handle);
/**
* @brief Starts a transcoding job.
*
* @param params Transcoding parameters.
* @return If it is successful it returns eav_success, otherwise corresponding error.
*/
int
xc(
xcparams_t *params);
/**
* @brief Starts a muxing job.
*
* @param params Muxing parameters.
* @return If it is successful it returns eav_success, otherwise corresponding error.
*/
int
mux(
xcparams_t *params);
/**
* @brief Returns pixel format name.
*
* @param pix_fmt pixel format id.
* @return Returns pixel format name.
*/
const char *
get_pix_fmt_name(
int pix_fmt);
/**
* @brief Returns profile name.
*
* @param codec_id codec id.
* @param profile profile id.
* @return Returns profile name.
*/
const char *
get_profile_name(
int codec_id,
int profile);
/**
* @brief Starts a probing job.
*
* @param params Probing parameters.
* @param xcprobe Probing information array, will be allocated inside this API.
* @param n_streams Number of entries/streams in probing information array.
* @return If it is successful it returns eav_success and fills xcprobe array and n_streams,
* otherwise returns corresponding error.
*/
int
probe(
xcparams_t *params,
xcprobe_t **xcprobe,
int *n_streams);
/**
* @brief Sets the Go loggers.
*
* @return void.
*/
void
set_loggers();