mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
完善写mp4文件
This commit is contained in:
parent
6c0d89f417
commit
13a6d3ac16
@ -147,11 +147,12 @@ void Mp4Maker::onTrackFrame(const Frame::Ptr &frame) {
|
||||
}
|
||||
}
|
||||
|
||||
void Mp4Maker::onAllTrackReady() {
|
||||
void Mp4Maker::onTrackReady(const Track::Ptr & track){
|
||||
//保存所有的track,为创建MP4MuxerFile做准备
|
||||
_tracks.emplace_back(getTrack(TrackVideo));
|
||||
_tracks.emplace_back(getTrack(TrackAudio));
|
||||
_haveVideo = getTrack(TrackVideo).operator bool();
|
||||
_tracks.emplace_back(track);
|
||||
if(track->getTrackType() == TrackVideo){
|
||||
_haveVideo = true;
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace mediakit */
|
||||
|
@ -70,10 +70,12 @@ private:
|
||||
*/
|
||||
void onTrackFrame(const Frame::Ptr &frame) override ;
|
||||
|
||||
/**
|
||||
* 所有Track准备好了
|
||||
*/
|
||||
void onAllTrackReady() override;
|
||||
/**
|
||||
* 某track已经准备好,其ready()状态返回true,
|
||||
* 此时代表可以获取其例如sps pps等相关信息了
|
||||
* @param track
|
||||
*/
|
||||
void onTrackReady(const Track::Ptr & track) override;
|
||||
private:
|
||||
void createFile();
|
||||
void closeFile();
|
||||
|
Loading…
Reference in New Issue
Block a user