Open Broadcaster Software
Free, open source software for live streaming and recording
obs-avc.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (C) 2014 by Hugh Bailey <obs.jim@gmail.com>
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17 
18 #pragma once
19 
20 #include "util/c99defs.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct encoder_packet;
27 
28 enum {
40 };
41 
42 enum {
47 };
48 
49 /* Helpers for parsing AVC NAL units. */
50 
51 EXPORT bool obs_avc_keyframe(const uint8_t *data, size_t size);
53  const uint8_t *end);
54 EXPORT void obs_parse_avc_packet(struct encoder_packet *avc_packet,
55  const struct encoder_packet *src);
56 EXPORT size_t obs_parse_avc_header(uint8_t **header, const uint8_t *data,
57  size_t size);
58 EXPORT void obs_extract_avc_headers(const uint8_t *packet, size_t size,
59  uint8_t **new_packet_data, size_t *new_packet_size,
60  uint8_t **header_data, size_t *header_size,
61  uint8_t **sei_data, size_t *sei_size);
62 
63 #ifdef __cplusplus
64 }
65 #endif
Definition: obs-avc.h:43
uint8_t * data
Definition: obs-encoder.h:42
Definition: obs-avc.h:30
size_t size
Definition: obs-encoder.h:43
Definition: obs-avc.h:35
EXPORT size_t obs_parse_avc_header(uint8_t **header, const uint8_t *data, size_t size)
Definition: obs-avc.h:44
Definition: obs-avc.h:38
EXPORT const uint8_t * obs_avc_find_startcode(const uint8_t *p, const uint8_t *end)
Definition: obs-encoder.h:41
unsigned char uint8_t
Definition: vc_stdint.h:27
Definition: obs-avc.h:32
#define EXPORT
Definition: c99defs.h:53
Definition: obs-avc.h:45
Definition: obs-avc.h:31
Definition: obs-avc.h:39
Definition: obs-avc.h:33
Definition: obs-avc.h:34
EXPORT bool obs_avc_keyframe(const uint8_t *data, size_t size)
Definition: obs-avc.h:29
Definition: obs-avc.h:36
EXPORT void obs_parse_avc_packet(struct encoder_packet *avc_packet, const struct encoder_packet *src)
Definition: obs-avc.h:37
Definition: obs-avc.h:46
EXPORT void obs_extract_avc_headers(const uint8_t *packet, size_t size, uint8_t **new_packet_data, size_t *new_packet_size, uint8_t **header_data, size_t *header_size, uint8_t **sei_data, size_t *sei_size)