diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-09-29 08:31:15 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-09-29 08:31:15 +0000 |
commit | 21bee233619f1e2187345efd4eaed85e49facc5b (patch) | |
tree | 53db607a42e99c01d67c8e0612b29ec9313b4755 /pjsip-apps/src | |
parent | 90bbdfb85e44e2be7a185a7f8288bd50371d735a (diff) |
Closed #1361: codec API change. Details:
- changed encode(), packetize(), unpacketize(), and decode() to encode_begin(), encode_more(), and decode()
- codec has new "packing" setting
- updated stream, aviplay, codec-test, and stream-util due to above
- minor doxygen documentation fixes here and there
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3776 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
-rw-r--r-- | pjsip-apps/src/samples/aviplay.c | 8 | ||||
-rw-r--r-- | pjsip-apps/src/samples/vid_streamutil.c | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/pjsip-apps/src/samples/aviplay.c b/pjsip-apps/src/samples/aviplay.c index 0682b9e9..2ceb727e 100644 --- a/pjsip-apps/src/samples/aviplay.c +++ b/pjsip-apps/src/samples/aviplay.c @@ -153,7 +153,8 @@ static pj_status_t codec_get_frame(pjmedia_port *port, status = pjmedia_port_get_frame(port_data->src_port, frame); if (status != PJ_SUCCESS) goto on_error; - status = pjmedia_vid_codec_decode(codec, frame, frame->size, &enc_frame); + status = pjmedia_vid_codec_decode(codec, 1, frame, + frame->size, &enc_frame); if (status != PJ_SUCCESS) goto on_error; frame->size = frame_size; @@ -166,7 +167,8 @@ static pj_status_t codec_get_frame(pjmedia_port *port, status = pjmedia_port_get_frame(port_data->src_port, &enc_frame); if (status != PJ_SUCCESS) goto on_error; - status = pjmedia_vid_codec_decode(codec, &enc_frame, frame->size, frame); + status = pjmedia_vid_codec_decode(codec, 1, &enc_frame, + frame->size, frame); if (status != PJ_SUCCESS) goto on_error; return PJ_SUCCESS; @@ -291,7 +293,7 @@ static int aviplay(pj_pool_t *pool, const char *fname) } pjmedia_format_copy(&codec_param.dec_fmt, ¶m.vidparam.fmt); - + codec_param.packing = PJMEDIA_VID_PACKING_WHOLE; status = pjmedia_vid_codec_open(codec, &codec_param); if (status != PJ_SUCCESS) { rc = 252; goto on_return; diff --git a/pjsip-apps/src/samples/vid_streamutil.c b/pjsip-apps/src/samples/vid_streamutil.c index 21be5c7c..fd75bfb3 100644 --- a/pjsip-apps/src/samples/vid_streamutil.c +++ b/pjsip-apps/src/samples/vid_streamutil.c @@ -301,8 +301,8 @@ static void clock_cb(const pj_timestamp *ts, void *user_data) write_frame.buf = play_file->dec_buf; write_frame.size = play_file->dec_buf_size; - status = decoder->op->decode(decoder, &read_frame, write_frame.size, - &write_frame); + status = pjmedia_vid_codec_decode(decoder, 1, &read_frame, + write_frame.size, &write_frame); if (status != PJ_SUCCESS) return; } else { @@ -615,6 +615,7 @@ int main(int argc, char *argv[]) if (play_file.file_name) { pjmedia_video_format_detail *file_vfd; pjmedia_clock_param clock_param; + char fmt_name[5]; /* Create file player */ status = create_file_player(pool, play_file.file_name, &play_port); @@ -624,12 +625,9 @@ int main(int argc, char *argv[]) /* Collect format info */ file_vfd = pjmedia_format_get_video_format_detail(&play_port->info.fmt, PJ_TRUE); - PJ_LOG(2, (THIS_FILE, "Reading video stream %dx%d %c%c%c%c @%.2ffps", + PJ_LOG(2, (THIS_FILE, "Reading video stream %dx%d %s @%.2ffps", file_vfd->size.w, file_vfd->size.h, - ((play_port->info.fmt.id & 0x000000FF) >> 0), - ((play_port->info.fmt.id & 0x0000FF00) >> 8), - ((play_port->info.fmt.id & 0x00FF0000) >> 16), - ((play_port->info.fmt.id & 0xFF000000) >> 24), + pjmedia_fourcc_name(play_port->info.fmt.id, fmt_name), (1.0*file_vfd->fps.num/file_vfd->fps.denum))); /* Allocate file read buffer */ |