Skip to content

Commit 7f56307

Browse files
committed
添加flv库
1 parent 3744353 commit 7f56307

File tree

5 files changed

+157
-0
lines changed

5 files changed

+157
-0
lines changed

.github/workflows/deploypod.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,30 @@ jobs:
148148
pod trunk push TIoTLinkKit_XP2P.podspec --verbose --allow-warnings --use-libraries
149149
env:
150150
COCOAPODS_TRUNK_TOKEN: ${{ secrets.IOT_COCOAPODS_TRUNK_TOKEN }}
151+
152+
153+
- name: Deploy flv SDK
154+
if: ${{contains(env.curr_tag, 'flv')}}
155+
run: |
156+
set -eo pipefail
157+
158+
temptag=$(git describe --tags `git rev-list --tags --max-count=1`)
159+
vtaglist=(${temptag//-/ })
160+
beta=${vtaglist[2]}
161+
version=${vtaglist[1]}
162+
if [ ${#beta} -gt 0 ]
163+
then
164+
version=${vtaglist[1]}-$beta
165+
fi
166+
version=${version#*v}
167+
echo $version
168+
169+
export LIB_VERSION=$version
170+
perl -i -pe "s#.*s.source .*#\ts.source = { :git => 'https://github.com/tencentyun/iot-thirdparty-ios.git', :tag => \"$temptag\" }#g" TIoTLinkKit_FLV.podspec
171+
172+
pod lib lint TIoTLinkKit_FLV.podspec --verbose --allow-warnings --use-libraries
173+
pod trunk push TIoTLinkKit_FLV.podspec --verbose --allow-warnings --use-libraries
174+
env:
175+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.IOT_COCOAPODS_TRUNK_TOKEN }}
176+
177+

Source/FLV-iOS/Classes/flv-muxer.h

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#ifndef _flv_muxer_h_
2+
#define _flv_muxer_h_
3+
4+
#include <stddef.h>
5+
#include <stdint.h>
6+
7+
#if defined(__cplusplus)
8+
extern "C" {
9+
#endif
10+
11+
typedef struct flv_muxer_t flv_muxer_t;
12+
13+
///Video: FLV VideoTagHeader + AVCVIDEOPACKET: AVCDecoderConfigurationRecord(ISO 14496-15) / One or more NALUs(four-bytes length + NALU)
14+
///Audio: FLV AudioTagHeader + AACAUDIODATA: AudioSpecificConfig(14496-3) / Raw AAC frame data in UI8
15+
///@param[in] data FLV Audio/Video Data(don't include FLV Tag Header)
16+
///@param[in] type 8-audio, 9-video
17+
///@return 0-ok, other-error
18+
typedef int (*flv_muxer_handler)(void* param, int type, const void* data, size_t bytes, uint32_t timestamp);
19+
20+
flv_muxer_t* flv_muxer_create(flv_muxer_handler handler, void* param);
21+
void flv_muxer_destroy(flv_muxer_t* muxer);
22+
23+
/// re-create AAC/AVC sequence header
24+
int flv_muxer_reset(flv_muxer_t* muxer);
25+
26+
/// @param[in] data AAC ADTS stream, 0xFFF15C40011FFC...
27+
int flv_muxer_aac(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts);
28+
29+
/// @param[in] data mp3 stream
30+
int flv_muxer_mp3(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts);
31+
32+
/// @param[in] data opus stream, first opus head, then opus samples
33+
int flv_muxer_opus(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts);
34+
35+
/// @param[in] data h.264 annexb bitstream: H.264 start code + H.264 NALU, 0x0000000168...
36+
int flv_muxer_avc(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts);
37+
38+
/// @param[in] data h.265 annexb bitstream: H.265 start code + H.265 NALU, 0x00000001...
39+
int flv_muxer_hevc(flv_muxer_t* muxer, const void* data, size_t bytes, uint32_t pts, uint32_t dts);
40+
41+
struct flv_metadata_t
42+
{
43+
int audiocodecid;
44+
double audiodatarate; // kbps
45+
int audiosamplerate;
46+
int audiosamplesize;
47+
int stereo;
48+
49+
int videocodecid;
50+
double videodatarate; // kbps
51+
double framerate; // fps
52+
double duration;
53+
int interval; // frame interval
54+
int width;
55+
int height;
56+
};
57+
58+
int flv_muxer_metadata(flv_muxer_t* muxer, const struct flv_metadata_t* metadata);
59+
60+
#if defined(__cplusplus)
61+
}
62+
#endif
63+
#endif /* !_flv_muxer_h_ */
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#ifndef _flv_writer_h_
2+
#define _flv_writer_h_
3+
4+
#include <stddef.h>
5+
#include <stdint.h>
6+
7+
#if defined(__cplusplus)
8+
extern "C" {
9+
#endif
10+
11+
struct flv_vec_t
12+
{
13+
void* ptr;
14+
int len;
15+
};
16+
17+
/// @param[in] param flv_writer_create2 param
18+
/// @param[in] n vec number
19+
/// @return 0-ok, other-error
20+
typedef int (*flv_writer_onwrite)(void* param, const struct flv_vec_t* vec, int n);
21+
22+
void* flv_writer_create(const char* file);
23+
/// @param[in] audio 1-has audio, 0-don't has audio
24+
/// @param[in] video 1-has video, 0-don't has video
25+
void* flv_writer_create2(int audio, int video, flv_writer_onwrite onwrite, void* param);
26+
27+
void flv_writer_destroy(void* flv);
28+
29+
/// Video: FLV VideoTagHeader + AVCVIDEOPACKET: AVCDecoderConfigurationRecord(ISO 14496-15) / One or more NALUs(four-bytes length + NALU)
30+
/// Audio: FLV AudioTagHeader + AACAUDIODATA: AudioSpecificConfig(14496-3) / Raw AAC frame data in UI8
31+
/// @param[in] data FLV Audio/Video Data(don't include FLV Tag Header)
32+
/// @param[in] type 8-audio, 9-video
33+
/// @return 0-ok, other-error
34+
int flv_writer_input(void* flv, int type, const void* data, size_t bytes, uint32_t timestamp);
35+
36+
int flv_writer_input_v(void* flv, int type, const struct flv_vec_t* vec, int num, uint32_t timestamp);
37+
38+
#if defined(__cplusplus)
39+
}
40+
#endif
41+
#endif /* !_flv_writer_h_ */

Source/FLV-iOS/liblibflv.a

497 KB
Binary file not shown.

TIoTLinkKit_FLV.podspec

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Pod::Spec.new do |s|
2+
s.name = 'TIoTLinkKit_FLV'
3+
s.version = ENV['LIB_VERSION'] || '1.0.0'
4+
s.summary = '该仓库为方便个人仓库构建使用,如有其他需求还请从官网下载原SDK'
5+
6+
s.description = <<-DESC
7+
在CI构建中,有些SDK没有提供供方便pod集成使用,在此仓库提供个聚合SDK以便更好的支持CI。
8+
DESC
9+
10+
s.homepage = 'https://github.com/tencentyun/iot-thirdparty-ios'
11+
s.license = { :type => 'MIT', :file => 'LICENSE' }
12+
s.author = { '[email protected]' => '[email protected]' }
13+
s.source = { :git => 'https://github.com/tencentyun/iot-thirdparty-ios.git', :tag => s.version.to_s }
14+
15+
s.ios.deployment_target = '9.0'
16+
# s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-all_load' }
17+
# s.static_framework = true
18+
19+
s.source_files = 'Source/FLV-iOS/Classes/**/*'
20+
s.vendored_libraries = 'Source/FLV-iOS/*.a'
21+
# s.frameworks = "NetworkExtension", "CoreGraphics", "SystemConfiguration", "Foundation", "UIKit"
22+
# s.libraries = 'c++', 'sqlite3', 'z'
23+
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
24+
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
25+
26+
end

0 commit comments

Comments
 (0)