-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3744353
commit 7f56307
Showing
5 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#ifndef _flv_muxer_h_ | ||
#define _flv_muxer_h_ | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct flv_muxer_t flv_muxer_t; | ||
|
||
///Video: FLV VideoTagHeader + AVCVIDEOPACKET: AVCDecoderConfigurationRecord(ISO 14496-15) / One or more NALUs(four-bytes length + NALU) | ||
///Audio: FLV AudioTagHeader + AACAUDIODATA: AudioSpecificConfig(14496-3) / Raw AAC frame data in UI8 | ||
///@param[in] data FLV Audio/Video Data(don't include FLV Tag Header) | ||
///@param[in] type 8-audio, 9-video | ||
///@return 0-ok, other-error | ||
typedef int (*flv_muxer_handler)(void* param, int type, const void* data, size_t bytes, uint32_t timestamp); | ||
|
||
flv_muxer_t* flv_muxer_create(flv_muxer_handler handler, void* param); | ||
void flv_muxer_destroy(flv_muxer_t* muxer); | ||
|
||
/// re-create AAC/AVC sequence header | ||
int flv_muxer_reset(flv_muxer_t* muxer); | ||
|
||
/// @param[in] data AAC ADTS stream, 0xFFF15C40011FFC... | ||
int flv_muxer_aac(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts); | ||
|
||
/// @param[in] data mp3 stream | ||
int flv_muxer_mp3(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts); | ||
|
||
/// @param[in] data opus stream, first opus head, then opus samples | ||
int flv_muxer_opus(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts); | ||
|
||
/// @param[in] data h.264 annexb bitstream: H.264 start code + H.264 NALU, 0x0000000168... | ||
int flv_muxer_avc(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts); | ||
|
||
/// @param[in] data h.265 annexb bitstream: H.265 start code + H.265 NALU, 0x00000001... | ||
int flv_muxer_hevc(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts); | ||
|
||
struct flv_metadata_t | ||
{ | ||
int audiocodecid; | ||
double audiodatarate; // kbps | ||
int audiosamplerate; | ||
int audiosamplesize; | ||
int stereo; | ||
|
||
int videocodecid; | ||
double videodatarate; // kbps | ||
double framerate; // fps | ||
double duration; | ||
int interval; // frame interval | ||
int width; | ||
int height; | ||
}; | ||
|
||
int flv_muxer_metadata(flv_muxer_t* muxer, const struct flv_metadata_t* metadata); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
#endif /* !_flv_muxer_h_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef _flv_writer_h_ | ||
#define _flv_writer_h_ | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
struct flv_vec_t | ||
{ | ||
void* ptr; | ||
int len; | ||
}; | ||
|
||
/// @param[in] param flv_writer_create2 param | ||
/// @param[in] n vec number | ||
/// @return 0-ok, other-error | ||
typedef int (*flv_writer_onwrite)(void* param, const struct flv_vec_t* vec, int n); | ||
|
||
void* flv_writer_create(const char* file); | ||
/// @param[in] audio 1-has audio, 0-don't has audio | ||
/// @param[in] video 1-has video, 0-don't has video | ||
void* flv_writer_create2(int audio, int video, flv_writer_onwrite onwrite, void* param); | ||
|
||
void flv_writer_destroy(void* flv); | ||
|
||
/// Video: FLV VideoTagHeader + AVCVIDEOPACKET: AVCDecoderConfigurationRecord(ISO 14496-15) / One or more NALUs(four-bytes length + NALU) | ||
/// Audio: FLV AudioTagHeader + AACAUDIODATA: AudioSpecificConfig(14496-3) / Raw AAC frame data in UI8 | ||
/// @param[in] data FLV Audio/Video Data(don't include FLV Tag Header) | ||
/// @param[in] type 8-audio, 9-video | ||
/// @return 0-ok, other-error | ||
int flv_writer_input(void* flv, int type, const void* data, size_t bytes, uint32_t timestamp); | ||
|
||
int flv_writer_input_v(void* flv, int type, const struct flv_vec_t* vec, int num, uint32_t timestamp); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
#endif /* !_flv_writer_h_ */ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'TIoTLinkKit_FLV' | ||
s.version = ENV['LIB_VERSION'] || '1.0.0' | ||
s.summary = '该仓库为方便个人仓库构建使用,如有其他需求还请从官网下载原SDK' | ||
|
||
s.description = <<-DESC | ||
在CI构建中,有些SDK没有提供供方便pod集成使用,在此仓库提供个聚合SDK以便更好的支持CI。 | ||
DESC | ||
|
||
s.homepage = 'https://github.com/tencentyun/iot-thirdparty-ios' | ||
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = { '[email protected]' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/tencentyun/iot-thirdparty-ios.git', :tag => s.version.to_s } | ||
|
||
s.ios.deployment_target = '9.0' | ||
# s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-all_load' } | ||
# s.static_framework = true | ||
|
||
s.source_files = 'Source/FLV-iOS/Classes/**/*' | ||
s.vendored_libraries = 'Source/FLV-iOS/*.a' | ||
# s.frameworks = "NetworkExtension", "CoreGraphics", "SystemConfiguration", "Foundation", "UIKit" | ||
# s.libraries = 'c++', 'sqlite3', 'z' | ||
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } | ||
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } | ||
|
||
end |