void _mc_gst_handle_input_buffer_used(mc_gst_core_t *core, media_packet_h packet)
{
- g_atomic_int_dec_and_test(&core->etb_count);
+ if (core) {
+ g_atomic_int_dec_and_test(&core->etb_count);
+ LOGD("@v(%d)e(%d) input port used(%d)----- ", core->video, core->encoder, core->etb_count);
+ }
if (core && core->user_cb[_MEDIACODEC_EVENT_TYPE_EMPTYBUFFER]) {
((mc_empty_buffer_cb)core->user_cb[_MEDIACODEC_EVENT_TYPE_EMPTYBUFFER])
break;
}
- return MEDIACODEC_ERROR_INVALID_STREAM;
-
INTERNAL_ERROR:
return MEDIACODEC_ERROR_INTERNAL;
}
void _mediacodec_process_input(App *app)
{
- gint i;
+ gint i, j;
gboolean have_frame = FALSE;
gint ret;
static guint64 pts = 0L;
media_packet_get_video_stride_width(pkt, 0, &stride_width);
offset = app->width*app->height;
- for (i = 0; i < app->height; i++) {
+ for (j = 0; j < app->height; j++) {
memcpy(buf_data_ptr, tmp, app->width);
buf_data_ptr += stride_width;
tmp += app->width;
media_packet_get_video_stride_width(pkt, 1, &stride_width);
size = app->width * app->height / 2;
- for (i = 0; i < app->height / 2; i++) {
+ for (j = 0; j < app->height / 2; j++) {
memcpy(buf_data_ptr, tmp, app->width);
buf_data_ptr += stride_width;
tmp += app->width;
media_packet_get_video_stride_width(pkt, 1, &stride_width);
size = (app->width>>1) * (app->height>>1);
- for (i = 0; i < app->height/2; i++) {
+ for (j = 0; j < app->height/2; j++) {
memcpy(buf_data_ptr, tmp, app->width/2);
buf_data_ptr += stride_width;
tmp += app->width/2;
media_packet_get_video_stride_width(pkt, 2, &stride_width);
offset += size;
- for (i = 0; i < app->height/2; i++) {
+ for (j = 0; j < app->height/2; j++) {
memcpy(buf_data_ptr, tmp, app->width/2);
buf_data_ptr += stride_width;
tmp += app->width/2;