Also, Fixed bug in calling media_format_get_audio_info for video case.
Change-Id: I5126d7d9f11d4a9d4131b95ac8ab335435b474f2
Signed-off-by: Joungkook Seo <jk7704.seo@samsung.com>
if (media_format_get_audio_info((media_format_h)(format), ¤t_mime, NULL, NULL, NULL, NULL)
== MEDIA_FORMAT_ERROR_NONE) {
if (track_mime != current_mime) {
- MX_E("audio track_mime is not matching with packet mime. returning");
+ MX_E("audio track_mime is not matching with packet mime. returning\n");
return MX_ERROR_INVALID_ARGUMENT;
}
} else {
/* return if track_mime is different to current_mime */
if (media_format_get_video_info((media_format_h)(current->media_format), &track_mime, NULL, NULL, NULL, NULL)
== MEDIA_FORMAT_ERROR_NONE) {
- if (media_format_get_audio_info((media_format_h)(format), ¤t_mime, NULL, NULL, NULL, NULL)
+ if (media_format_get_video_info((media_format_h)(format), ¤t_mime, NULL, NULL, NULL, NULL)
== MEDIA_FORMAT_ERROR_NONE) {
if (track_mime != current_mime) {
- MX_E("video track_mime is not matching with packet mime. returning");
+ MX_E("video track_mime is not matching with packet mime. returning\n");
return MX_ERROR_INVALID_ARGUMENT;
}
} else {
bool have_mp4 = false;
bool have_vid_track = false;
bool have_aud_track = false;
-int track_index_vid;
-int track_index_aud;
-int track_index_aud2;
+int track_index_vid = -1;
+int track_index_aud = -1;
+int track_index_aud2 = -1;
int g_menu_state = CURRENT_STATUS_MAINMENU;
int demux_mp4();
/* To add audio track */
mediamuxer_add_track(myMuxer, media_format_a, &track_index_aud);
+ g_print("Audio Track index returned is: %d\n", track_index_aud);
if (validate_multitrack) {
mediamuxer_add_track(myMuxer, media_format_a, &track_index_aud2);
- g_print("Audio Track index is returned : %d\n", track_index_aud2);
+ g_print("Audio Multi-Track index returned is: %d\n", track_index_aud2);
}
-
- g_print("Audio Track index is returned : %d\n", track_index_aud);
return 0;
}
int key;
GstMapInfo map;
- if (count == 0)
- g_print("Called __audio_app_sink_callback\n");
+ if (count == 0) {
+ g_print("Called __audio_app_sink_callback, track_index_aud = %d\n", track_index_aud);
+ if (validate_multitrack)
+ g_print("track_index_aud2 = %d\n", track_index_aud2);
+ g_print("audio data_sink = %s\n", data_sink);
+ }
g_signal_emit_by_name(sink, "pull-sample", &sample);
buffer = gst_sample_get_buffer(sample);
media_packet_h vid_pkt;
uint64_t ns;
static int count = 0;
- unsigned int vsize;
int key;
guint8 *dptr;
GstMapInfo map;
GstSample *sample;
-
- if (count == 0)
- g_print("Called __video_app_sink_callback\n");
+ GstStructure *caps_struc = NULL;
+ GstCaps *vid_caps_gst = NULL;
+ gint video_width;
+ gint video_height;
+ gboolean ret = false;
+
+ if (count == 0) {
+ g_print("Called __video_app_sink_callback. track_index_vid = %d\n", track_index_vid);
+ g_print("video data_sink = %s\n", data_sink);
+ }
g_signal_emit_by_name(sink, "pull-sample", &sample);
buffer = gst_sample_get_buffer(sample);
key = 0;
}
- vsize = map.size;
- media_format_set_video_width(vidfmt, vsize/2+1);
- media_format_set_video_height(vidfmt, vsize/2+1);
+ vid_caps_gst = gst_caps_from_string(vid_caps);
+ caps_struc = gst_caps_get_structure(vid_caps_gst, 0);
+
+ ret = gst_structure_get_int(caps_struc, "width", &video_width);
+ ret = ret && gst_structure_get_int(caps_struc, "height", &video_height);
+ if (!ret) {
+ g_print("Failed to retrive video width/height. returning. \n");
+ return;
+ }
+
+ if (count == 0)
+ g_print("Extracted width=%d, height=%d\n", video_width, video_height);
+ media_format_set_video_width(vidfmt, video_width);
+ media_format_set_video_height(vidfmt, video_height);
/* frame rate is came from the caps filter of demuxer */
if (media_format_set_video_frame_rate(vidfmt, 30)) {
g_print("media_format_set_video_frame_rate failed\n");