mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #316, add stream codec info. 2.0.135
This commit is contained in:
parent
885b9af122
commit
2e9f2753c9
6 changed files with 109 additions and 17 deletions
|
@ -1531,9 +1531,10 @@ int SrsSource::on_video(SrsCommonMessage* __video)
|
|||
}
|
||||
|
||||
srs_trace("%dB video sh, "
|
||||
"codec(%d, profile=%d, level=%d, %dx%d, %dkbps, %dfps, %ds)",
|
||||
"codec(%d, profile=%s, level=%s, %dx%d, %dkbps, %dfps, %ds)",
|
||||
msg.size, codec.video_codec_id,
|
||||
codec.avc_profile, codec.avc_level, codec.width, codec.height,
|
||||
srs_codec_avc_profile2str(codec.avc_profile).c_str(),
|
||||
srs_codec_avc_level2str(codec.avc_level).c_str(), codec.width, codec.height,
|
||||
codec.video_data_rate / 1000, codec.frame_rate, codec.duration);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -53,8 +53,8 @@ SrsStatisticStream::SrsStatisticStream()
|
|||
|
||||
has_video = false;
|
||||
vcodec = SrsCodecVideoReserved;
|
||||
avc_profile = 0;
|
||||
avc_level = 0;
|
||||
avc_profile = SrsAvcProfileReserved;
|
||||
avc_level = SrsAvcLevelReserved;
|
||||
|
||||
has_audio = false;
|
||||
acodec = SrsCodecAudioReserved1;
|
||||
|
@ -111,7 +111,7 @@ SrsStatistic* SrsStatistic::instance()
|
|||
}
|
||||
|
||||
int SrsStatistic::on_video_info(SrsRequest* req,
|
||||
SrsCodecVideo vcodec, u_int8_t avc_profile, u_int8_t avc_level
|
||||
SrsCodecVideo vcodec, SrsAvcProfile avc_profile, SrsAvcLevel avc_level
|
||||
) {
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
@ -243,8 +243,8 @@ int SrsStatistic::dumps_streams(stringstream& ss)
|
|||
ss << __SRS_JFIELD_NAME("video")
|
||||
<< __SRS_JOBJECT_START
|
||||
<< __SRS_JFIELD_STR("codec", srs_codec_video2str(stream->vcodec)) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_ORG("profile", (int)stream->avc_profile) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_ORG("level", (int)stream->avc_level)
|
||||
<< __SRS_JFIELD_STR("profile", srs_codec_avc_profile2str(stream->avc_profile)) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_ORG("level", srs_codec_avc_level2str(stream->avc_level))
|
||||
<< __SRS_JOBJECT_END
|
||||
<< __SRS_JFIELD_CONT;
|
||||
}
|
||||
|
|
|
@ -59,9 +59,9 @@ public:
|
|||
bool has_video;
|
||||
SrsCodecVideo vcodec;
|
||||
// profile_idc, H.264-AVC-ISO_IEC_14496-10.pdf, page 45.
|
||||
u_int8_t avc_profile;
|
||||
SrsAvcProfile avc_profile;
|
||||
// level_idc, H.264-AVC-ISO_IEC_14496-10.pdf, page 45.
|
||||
u_int8_t avc_level;
|
||||
SrsAvcLevel avc_level;
|
||||
public:
|
||||
bool has_audio;
|
||||
SrsCodecAudio acodec;
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
* when got video info for stream.
|
||||
*/
|
||||
virtual int on_video_info(SrsRequest* req,
|
||||
SrsCodecVideo vcodec, u_int8_t avc_profile, u_int8_t avc_level
|
||||
SrsCodecVideo vcodec, SrsAvcProfile avc_profile, SrsAvcLevel avc_level
|
||||
);
|
||||
/**
|
||||
* when got audio info for stream.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue