yolobs-studio/plugins/obs-outputs/flv-mux.h

41 lines
1.6 KiB
C
Raw Permalink Normal View History

2016-02-23 23:16:51 +00:00
/******************************************************************************
Copyright (C) 2014 by Hugh Bailey <obs.jim@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#pragma once
#include <obs.h>
2019-09-22 21:19:10 +00:00
#define MILLISECOND_DEN 1000
2016-02-23 23:16:51 +00:00
2018-02-19 19:54:37 +00:00
static int32_t get_ms_time(struct encoder_packet *packet, int64_t val)
2016-02-23 23:16:51 +00:00
{
2018-02-19 19:54:37 +00:00
return (int32_t)(val * MILLISECOND_DEN / packet->timebase_den);
2016-02-23 23:16:51 +00:00
}
extern void write_file_info(FILE *file, int64_t duration_ms, int64_t size);
2020-10-01 20:15:25 +00:00
extern void flv_meta_data(obs_output_t *context, uint8_t **output, size_t *size,
bool write_header);
extern void flv_additional_meta_data(obs_output_t *context, uint8_t **output,
size_t *size);
2018-02-19 19:54:37 +00:00
extern void flv_packet_mux(struct encoder_packet *packet, int32_t dts_offset,
2019-09-22 21:19:10 +00:00
uint8_t **output, size_t *size, bool is_header);
2020-10-01 20:15:25 +00:00
extern void flv_additional_packet_mux(struct encoder_packet *packet,
int32_t dts_offset, uint8_t **output,
size_t *size, bool is_header,
size_t index);