#include <appcore-efl.h>
#include <Elementary.h>
#include <Ecore.h>
-#include <Ecore_Wayland.h>
#include <stdio.h>
#include <string.h>
#ifdef _ACTIVATE_EOM_
TIZEN_PROFILE_TV = 0x4,
TIZEN_PROFILE_IVI = 0x8,
TIZEN_PROFILE_COMMON = 0x10,
-} tizen_profile_t;
+} tizen_profile_e;
typedef struct {
- int bandwidth;
- int width;
- int height;
-} adaptive_variant_info_t;
-
-typedef struct {
- int buffer_ms;
- int rebuffer_ms;
-} buffer_size_t;
+ uint64_t mask;
+ FILE *fp_out;
+} audio_pcm_dump_t;
#ifdef USE_EVENT_HANDLER
-static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void * data, float e[3]);
+static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void *data, float e[3]);
static void event_handler_set_dov_fov();
static void event_handler_set_window_parameters();
mm_navevent_handler_h event_handler;
mm_navevent_handler_size_s image_size;
#endif
-static tizen_profile_t _get_tizen_profile()
+static tizen_profile_e _get_tizen_profile()
{
char *profileName;
- static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+ static tizen_profile_e profile = TIZEN_PROFILE_UNKNOWN;
if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
return profile;
#if DUMP_OUTBUF
FILE *fp_out1 = NULL;
FILE *fp_out2 = NULL;
+GList *audio_dump_list = NULL;
#endif
enum {
CURRENT_STATUS_HANDLE_NUM,
CURRENT_STATUS_FILENAME,
CURRENT_STATUS_VOLUME,
- CURRENT_STATUS_SOUND_TYPE,
CURRENT_STATUS_SOUND_STREAM_INFO,
CURRENT_STATUS_MUTE,
CURRENT_STATUS_POSITION_TIME,
CURRENT_STATUS_LOOPING,
CURRENT_STATUS_DISPLAY_SURFACE_CHANGE,
+ CURRENT_STATUS_EXPORT_VIDEO_FRAME,
CURRENT_STATUS_DISPLAY_MODE,
- CURRENT_STATUS_DISPLAY_DST_ROI,
+ CURRENT_STATUS_DISPLAY_DST_ROI_AREA,
CURRENT_STATUS_DISPLAY_ROTATION,
CURRENT_STATUS_DISPLAY_VISIBLE,
CURRENT_STATUS_SUBTITLE_FILENAME,
CURRENT_STATUS_AUDIO_EQUALIZER,
CURRENT_STATUS_PLAYBACK_RATE,
CURRENT_STATUS_STREAMING_PLAYBACK_RATE,
- CURRENT_STATUS_SWITCH_SUBTITLE,
+ CURRENT_STATUS_SET_TRACK_TYPE,
+ CURRENT_STATUS_SET_TRACK_INDEX,
CURRENT_STATUS_NEXT_URI,
CURRENT_STATUS_GAPLESS,
CURRENT_STATUS_GET_TRACK_INFO,
CURRENT_STATUS_VIDEO360_SET_FOV,
CURRENT_STATUS_VIDEO360_SET_FOV1,
CURRENT_STATUS_VIDEO360_SET_ZOOM,
- CURRENT_STATUS_AUDIO_CODEC_TYPE,
+ CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV,
+ CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV1,
+ CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV2,
CURRENT_STATUS_VIDEO_CODEC_TYPE,
+ CURRENT_STATUS_REPLAYGAIN_ENABLE,
+ CURRENT_STATUS_AUDIO_OFFLOAD,
+ CURRENT_STATUS_PITCH_CONTROL,
+ CURRENT_STATUS_PITCH_VALUE,
+ CURRENT_STATUS_EXPORT_PCM_OPTION,
+ CURRENT_STATUS_EXPORT_PCM_CH,
+ CURRENT_STATUS_EXPORT_PCM_RATE,
+ CURRENT_STATUS_EXPORT_PCM_MIME,
};
-typedef struct {
- int pos;
- bool accurate;
-} player_seek_pos_t;
-
-typedef struct {
- int a_codec_type;
- int v_codec_type;
-} player_codec_type_t;
-
#define MAX_HANDLE 20
/* for video display */
static Evas_Object *g_eo[MAX_HANDLE] = { 0, };
static int g_current_surface_type = -1;
-static adaptive_variant_info_t max_limit = {-1, -1, -1};
-static buffer_size_t buff_size = {-1, -1};
typedef struct {
Evas_Object *win;
static appdata ad;
static player_h g_player[MAX_HANDLE] = { 0, };
-static player_seek_pos_t seek_info = {0};
-static player_codec_type_t codec_type = {0};
+
int g_handle_num = 1;
int g_menu_state = CURRENT_STATUS_MAINMENU;
gboolean quit_pushing;
sound_stream_info_h g_stream_info_h = NULL;
-static void win_del(void *data, Evas_Object * obj, void *event)
+static void win_del(void *data, Evas_Object *obj, void *event)
{
elm_exit();
}
return eo;
}
-static Evas_Object *create_image_object(Evas_Object * eo_parent)
+static Evas_Object *create_image_object(Evas_Object *eo_parent)
{
if (!eo_parent)
return NULL;
return eo;
}
-void create_render_rect_and_bg(Evas_Object * win)
+void create_render_rect_and_bg(Evas_Object *win)
{
if (!win) {
g_print("no win");
static void eom_notify_cb_output_add(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata *) user_data;
+ appdata *info = (appdata *)user_data;
if (info->hdmi_output_id != output_id) {
g_print("[eom] OUTPUT ADDED. SKIP. my output ID is %d\n", info->hdmi_output_id);
static void eom_notify_cb_output_remove(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata *) user_data;
+ appdata *info = (appdata *)user_data;
player_state_e state;
if (info->hdmi_output_id != output_id) {
static void eom_notify_cb_mode_changed(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata *) user_data;
+ appdata *info = (appdata *)user_data;
eom_output_mode_e mode = EOM_OUTPUT_MODE_NONE;
if (info->hdmi_output_id != output_id) {
static void eom_notify_cb_attribute_changed(eom_output_id output_id, void *user_data)
{
- appdata *info = (appdata *) user_data;
+ appdata *info = (appdata *)user_data;
eom_output_attribute_e attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
eom_output_attribute_state_e state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
g_print("[Player_Test] prepared_cb!!!!\n");
}
-static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s * audio_raw_frame, void *user_data)
-{
- player_audio_raw_data_s *audio_raw = audio_raw_frame;
-
- if (!audio_raw)
- return;
-
- g_print("[Player_Test] decoded_cb_ex! channel: %d channel_mask: %llu\n", audio_raw->channel, audio_raw->channel_mask);
-
-#if DUMP_OUTBUF
- if (audio_raw->channel_mask == 1 && fp_out1)
- fwrite((guint8 *) audio_raw->data, 1, audio_raw->size, fp_out1);
- else if (audio_raw->channel_mask == 2 && fp_out2)
- fwrite((guint8 *) audio_raw->data, 1, audio_raw->size, fp_out2);
-#endif
-}
-
-static void progress_down_cb(player_pd_message_type_e type, void *user_data)
-{
- g_print("[Player_Test] progress_down_cb!!!! type : %d\n", type);
-}
-
static void buffering_cb(int percent, void *user_data)
{
g_print("[Player_Test] buffering_cb!!!! percent : %d\n", percent);
return TRUE;
}
-
+#ifdef NO_USE_CODE
static void reset_display()
{
int i = 0;
}
}
}
-
+#endif
static void input_filename(char *filename)
{
int len = strlen(filename);
file = g_mapped_file_new(ext, FALSE, &error);
file_size = g_mapped_file_get_length(file);
- g_media_mem = (guint8 *) g_mapped_file_get_contents(file);
+ g_media_mem = (guint8 *)g_mapped_file_get_contents(file);
g_sprintf(uri, "mem://ext=%s,size=%d", ext ? ext : "", file_size);
g_print("[uri] = %s\n", uri);
file = g_mapped_file_new(g_uri, FALSE, NULL);
file_size = g_mapped_file_get_length(file);
- g_media_mem = (guint8 *) g_mapped_file_get_contents(file);
+ g_media_mem = (guint8 *)g_mapped_file_get_contents(file);
int ret = player_set_memory_buffer(g_player[0], (void *)g_media_mem, file_size);
g_print("player_set_memory_buffer ret : %d\n", ret);
fp = fopen(fname, "rb");
if (fp) {
- buff_ptr = (guint8 *) g_malloc0(1048576);
+ buff_ptr = (guint8 *)g_malloc0(1048576);
if (!buff_ptr) {
g_print("no free space\n");
fclose(fp);
g_video_pkt = NULL;
}
- media_packet_create_alloc(g_video_fmt, NULL, NULL, &g_video_pkt);
+ if (media_packet_create_alloc(g_video_fmt, NULL, NULL, &g_video_pkt) != MEDIA_PACKET_ERROR_NONE) {
+ g_print("media_packet_create_alloc failed\n");
+ goto EXIT;
+ }
g_print("packet = %p, src = %p\n", g_video_pkt, src);
if (media_packet_get_buffer_data_ptr(g_video_pkt, &src) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
- if (media_packet_set_pts(g_video_pkt, (uint64_t) pts) != MEDIA_PACKET_ERROR_NONE)
+ if (media_packet_set_pts(g_video_pkt, (uint64_t)pts) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
- if (media_packet_set_buffer_size(g_video_pkt, (uint64_t) real_read_len) != MEDIA_PACKET_ERROR_NONE)
+ if (media_packet_set_buffer_size(g_video_pkt, (uint64_t)real_read_len) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
memcpy(src, buff_ptr, real_read_len);
player_push_media_stream(g_player[0], g_video_pkt);
#endif
- EXIT:
- if (buff_ptr) {
- g_free(buff_ptr);
- buff_ptr = NULL;
- }
+EXIT:
+ g_free(buff_ptr);
}
int audio_packet_count = 0;
fp = fopen(fname, "rb");
if (fp) {
- buff_ptr = (guint8 *) g_malloc0(1048576);
+ buff_ptr = (guint8 *)g_malloc0(1048576);
if (!buff_ptr) {
g_print("no free space\n");
fclose(fp);
media_packet_destroy(g_audio_pkt);
g_audio_pkt = NULL;
}
- media_packet_create_alloc(g_audio_fmt, NULL, NULL, &g_audio_pkt);
+
+ if (media_packet_create_alloc(g_audio_fmt, NULL, NULL, &g_audio_pkt) != MEDIA_PACKET_ERROR_NONE) {
+ g_print("media_packet_create_alloc failed\n");
+ goto EXIT;
+ }
g_print("packet = %p, src = %p\n", g_audio_pkt, src);
if (media_packet_get_buffer_data_ptr(g_audio_pkt, &src) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
- if (media_packet_set_pts(g_audio_pkt, (uint64_t) audio_pts) != MEDIA_PACKET_ERROR_NONE)
+ if (media_packet_set_pts(g_audio_pkt, (uint64_t)audio_pts) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
- if (media_packet_set_buffer_size(g_audio_pkt, (uint64_t) real_read_len) != MEDIA_PACKET_ERROR_NONE)
+ if (media_packet_set_buffer_size(g_audio_pkt, (uint64_t)real_read_len) != MEDIA_PACKET_ERROR_NONE)
goto EXIT;
memcpy(src, buff_ptr, real_read_len);
#endif
audio_pts += audio_dur;
- EXIT:
- if (buff_ptr) {
- g_free(buff_ptr);
- buff_ptr = NULL;
- }
+
+EXIT:
+ g_free(buff_ptr);
}
static void set_content_info(bool is_push_mode)
media_packet_destroy(g_audio_pkt);
#if DUMP_OUTBUF
+ GList *list = NULL;
+ audio_pcm_dump_t *a_data = NULL;
+
+ list = audio_dump_list;
+ while(list) {
+ a_data = (audio_pcm_dump_t *)list->data;
+ list = g_list_next(list);
+ if (a_data && a_data->fp_out)
+ fclose(a_data->fp_out);
+ g_free(a_data);
+ }
+ g_list_free(audio_dump_list);
+ audio_dump_list = NULL;
+
if (fp_out1)
fclose(fp_out1);
if (fp_out2)
g_print(" ==> [Player_Test] Current Player State : %d\n", state);
}
-static void _player_set_progressive_download()
-{
- player_set_progressive_download_path(g_player[0], "/home/owner/test.pd");
- player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]);
-}
-
-static void _player_get_progressive_download_status()
-{
- int bRet = 0;
- unsigned long curr = 0, total = 0;
- bRet = player_get_progressive_download_status(g_player[0], &curr, &total);
- g_print("player_get_progressive_download_status return[%d] ==> [Player_Test] progressive download status : %lu/%lu\n", bRet, curr, total);
-}
-
static void _player_enable_tsurf_pool(void)
{
bool enabled = FALSE;
player_enable_tsurf_pool(g_player[0], !enabled);
}
-static void set_next_uri(char * uri)
+static void set_next_uri(char *uri)
{
if (TIZEN_TV) {
g_print("not support at TV profile");
g_print("failed to set_mute\n");
}
-static void get_mute(bool * mute)
+static void get_mute(bool *mute)
{
player_is_muted(g_player[0], mute);
g_print(" ==> [Player_Test] mute = %d\n", *mute);
}
-static void set_sound_type(sound_type_e type)
-{
- if (player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE)
- g_print("failed to set sound type(%d)\n", type);
- else
- g_print("set sound type(%d) success", type);
-}
-
void focus_callback(sound_stream_info_h stream_info,
sound_stream_focus_mask_e focus_mask,
sound_stream_focus_state_e focus_state,
else
g_print("set stream information(%p) success", g_stream_info_h);
- END:
+END:
if (device_list)
sound_manager_free_device_list(device_list);
return;
g_print(" ==> [Player_Test]get [b]%d, [w]%d, [h]%d\n", bandwidth, width, height);
}
-static void set_variant_limit()
+static void set_variant_limit(int bandwidth, int width, int height)
{
- g_print(" ==> [Player_Test]set [b]%d, [w]%d, [h]%d\n", max_limit.bandwidth, max_limit.width, max_limit.height);
- player_set_max_adaptive_variant_limit(g_player[0], max_limit.bandwidth, max_limit.width, max_limit.height);
+ g_print(" ==> [Player_Test]set [b]%d, [w]%d, [h]%d\n", bandwidth, width, height);
+ player_set_max_adaptive_variant_limit(g_player[0], bandwidth, width, height);
}
-static void set_buffer_size()
+static void set_buffer_size(int prebuffer, int rebuffer)
{
int ret = 0;
int buffer_ms = 0, rebuffer_ms = 0;
else
g_print("current buffer size %d ms / %d ms\n", buffer_ms, rebuffer_ms);
- g_print("new buffer size %d ms / %d ms\n", buff_size.buffer_ms, buff_size.rebuffer_ms);
+ g_print("new buffer size %d ms / %d ms\n", prebuffer, rebuffer);
+
+ player_set_streaming_buffering_time(g_player[0], prebuffer, rebuffer);
+}
- player_set_streaming_buffering_time(g_player[0], buff_size.buffer_ms, buff_size.rebuffer_ms);
+static void get_buffering_position()
+{
+ int ret;
+ int start = 0, end = 0;
+ ret = player_get_streaming_download_progress(g_player[0], &start, &end);
+ g_print(" ==> [Player_Test] buffering pos ()%d return : %d ~ %d\n", ret, start, end);
}
static void get_position()
g_print(" ==> [Player_Test] Duration: [%d ] msec\n", duration);
}
-static void set_codec_type(void)
+static void set_video_codec_type(int v_codec_type)
{
int ret;
- ret = player_set_codec_type(g_player[0], PLAYER_STREAM_TYPE_AUDIO, codec_type.a_codec_type);
- g_print(" ==> [Player_Test] audio codec type (%d) return: %d\n", codec_type.a_codec_type, ret);
-
- ret = player_set_codec_type(g_player[0], PLAYER_STREAM_TYPE_VIDEO, codec_type.v_codec_type);
- g_print(" ==> [Player_Test] video codec type (%d) return: %d\n", codec_type.v_codec_type, ret);
+ ret = player_set_video_codec_type_ex(g_player[0], v_codec_type);
+ g_print(" ==> [Player_Test] video codec type (%d) return: %d\n", v_codec_type, ret);
}
static void get_codec_type(void)
{
int ret;
- player_codec_type_e atype = 0, vtype = 0;
+ player_video_codec_type_ex_e vtype = 0;
- ret = player_get_codec_type(g_player[0], PLAYER_STREAM_TYPE_AUDIO, &atype);
- g_print(" ==> [Player_Test] Audio Codec type: [%d][ret 0x%X]\n", atype, ret);
-
- ret = player_get_codec_type(g_player[0], PLAYER_STREAM_TYPE_VIDEO, &vtype);
+ ret = player_get_video_codec_type_ex(g_player[0], &vtype);
g_print(" ==> [Player_Test] Video Codec type: [%d][ret 0x%X]\n", vtype, ret);
}
-static void audio_frame_decoded_cb_ex(bool sync)
-{
- int ret;
-#if DUMP_OUTBUF
- fp_out1 = fopen("/tmp/out1.pcm", "wb");
- fp_out2 = fopen("/tmp/out2.pcm", "wb");
- if (!fp_out1 || !fp_out2) {
- g_print("File open error\n");
- return;
- }
-#endif
-
- ret = player_set_pcm_extraction_mode(g_player[0], sync, _audio_frame_decoded_cb_ex, &ret);
- g_print(" ==> [Player_Test] player_set_audio_frame_decoded_cb_ex(sync:%d) ret:%d\n", sync, ret);
-
- ret = player_set_pcm_spec(g_player[0], "F32LE", 44100, 2);
- g_print("[Player_Test] set_pcm_spec return: %d\n", ret);
-}
-
static void get_stream_info()
{
int w = 0;
}
}
-static void get_looping(bool * looping)
+static void get_looping(bool *looping)
{
player_is_looping(g_player[0], looping);
g_print(" ==> [Player_Test] looping = %d\n", *looping);
}
+void _video_decoded_cb(media_packet_h packet, void *user_data)
+{
+ media_packet_destroy(packet);
+}
+
+static void set_video_frame_decoded_cb(void)
+{
+ player_set_media_packet_video_frame_decoded_cb(g_player[0], _video_decoded_cb, g_player[0]);
+}
+
+void _audio_decoded_cb(media_packet_h packet, void *user_data)
+{
+ int mime, channel, rate;
+ uint64_t channel_mask;
+ uint64_t size;
+ void *pkt_data;
+
+ if (!packet) {
+ g_print("invalid packet param");
+ return;
+ }
+
+ media_packet_get_format(packet, &g_audio_fmt);
+ media_format_get_audio_info(g_audio_fmt, (media_format_mimetype_e *)&mime, &channel, &rate, NULL, NULL);
+ media_format_get_audio_channel_mask(g_audio_fmt, &channel_mask);
+ media_packet_get_buffer_data_ptr(packet, &pkt_data);
+ media_packet_get_buffer_size(packet, &size);
+
+ g_print("[ received ] channel: %d size: %"G_GUINT64_FORMAT", mask %"G_GUINT64_FORMAT"\n", channel, size, channel_mask);
+
+#if DUMP_OUTBUF
+ GList *list = NULL;
+ audio_pcm_dump_t *a_data = NULL;
+ FILE *fp_dump = NULL;
+ char file_path[32];
+
+ list = audio_dump_list;
+ while(list) {
+ a_data = (audio_pcm_dump_t *)list->data;
+ list = g_list_next(list);
+
+ if (a_data && a_data->mask == channel_mask) {
+ fp_dump = a_data->fp_out;
+ break;
+ }
+ }
+
+ a_data = NULL;
+ if (!fp_dump) {
+ a_data = g_try_malloc(sizeof(audio_pcm_dump_t));
+ if (a_data == NULL) {
+ g_print("failed to malloc");
+ goto EXIT;
+ }
+
+ snprintf(file_path, 32, "/tmp/out%"G_GUINT64_FORMAT".pcm", channel_mask);
+
+ a_data->mask = channel_mask;
+ a_data->fp_out = fopen(file_path, "wb");
+ if (!a_data->fp_out) {
+ g_free(a_data);
+ g_print("[ERROR] failed to open file\n");
+ goto EXIT;
+ }
+
+ audio_dump_list = g_list_append(audio_dump_list, a_data);
+ fp_dump = a_data->fp_out;
+ }
+
+ fwrite((guint8 *)pkt_data, 1, size, fp_dump);
+#endif
+
+EXIT:
+ media_packet_destroy(packet);
+}
+
+static media_format_mimetype_e __convert_audio_pcm_str_to_media_format_mime(char *audio_pcm_str)
+{
+ int len = strlen("S16LE");
+ if (!audio_pcm_str) {
+ g_print("audio pcm str is NULL\n");
+ return MEDIA_FORMAT_MAX;
+ }
+
+ if (!strncasecmp(audio_pcm_str, "S16LE", len))
+ return MEDIA_FORMAT_PCM_S16LE;
+ else if (!strncasecmp(audio_pcm_str, "S24LE", len))
+ return MEDIA_FORMAT_PCM_S24LE;
+ else if (!strncasecmp(audio_pcm_str, "S32LE", len))
+ return MEDIA_FORMAT_PCM_S32LE;
+ else if (!strncasecmp(audio_pcm_str, "S16BE", len))
+ return MEDIA_FORMAT_PCM_S16BE;
+ else if (!strncasecmp(audio_pcm_str, "S24BE", len))
+ return MEDIA_FORMAT_PCM_S24BE;
+ else if (!strncasecmp(audio_pcm_str, "S32BE", len))
+ return MEDIA_FORMAT_PCM_S32BE;
+ else if (!strncasecmp(audio_pcm_str, "F32LE", len))
+ return MEDIA_FORMAT_PCM_F32LE;
+ else if (!strncasecmp(audio_pcm_str, "F32BE", len))
+ return MEDIA_FORMAT_PCM_F32BE;
+ else if (!strncasecmp(audio_pcm_str, "U16LE", len))
+ return MEDIA_FORMAT_PCM_U16LE;
+ else if (!strncasecmp(audio_pcm_str, "U24LE", len))
+ return MEDIA_FORMAT_PCM_U24LE;
+ else if (!strncasecmp(audio_pcm_str, "U32LE", len))
+ return MEDIA_FORMAT_PCM_U32LE;
+ else if (!strncasecmp(audio_pcm_str, "U16BE", len))
+ return MEDIA_FORMAT_PCM_U16BE;
+ else if (!strncasecmp(audio_pcm_str, "U24BE", len))
+ return MEDIA_FORMAT_PCM_U24BE;
+ else if (!strncasecmp(audio_pcm_str, "U32BE", len))
+ return MEDIA_FORMAT_PCM_U32BE;
+ else {
+ g_print("Not supported audio pcm format str : %s\n", audio_pcm_str);
+ return MEDIA_FORMAT_MAX;
+ }
+}
+
+static void set_audio_frame_decoded_cb(player_audio_extract_option_e opt, char* mime, int ch, int rate)
+{
+ media_format_mimetype_e type = __convert_audio_pcm_str_to_media_format_mime(mime);
+
+ if (type == MEDIA_FORMAT_MAX) {
+ g_print("failed to convert the mime : %s\n", mime);
+ return;
+ }
+
+ media_format_create(&g_audio_fmt);
+ media_format_set_audio_mime(g_audio_fmt, type);
+ media_format_set_audio_channel(g_audio_fmt, ch);
+ media_format_set_audio_samplerate(g_audio_fmt, rate);
+
+ g_print("==========> [Player_Test] option = 0x%X, %s(%d), %d, %d\n", opt, mime, type, ch, rate);
+ player_set_media_packet_audio_frame_decoded_cb(g_player[0], g_audio_fmt, opt, _audio_decoded_cb, g_player[0]);
+
+ media_format_unref(g_audio_fmt);
+ g_audio_fmt = NULL;
+}
+
static void change_surface(int option)
{
player_display_type_e surface_type = 0;
return;
}
- if (surface_type == g_current_surface_type) {
- g_print("same with the previous surface type(%d)\n", g_current_surface_type);
- return;
- } else {
- player_state_e player_state = PLAYER_STATE_NONE;
- ret = player_get_state(g_player[0], &player_state);
- if (ret)
- g_print("failed to player_get_state(), ret(0x%x)\n", ret);
-
- reset_display();
-
- if (surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
-#ifdef _ACTIVATE_EOM_
- hdmi_output_id = eom_get_output_id("HDMI");
- if (hdmi_output_id == 0)
- g_print("[eom] error : HDMI output id is NULL.\n");
-
- eom_get_output_mode(hdmi_output_id, &output_mode);
- if (output_mode == EOM_OUTPUT_MODE_NONE) {
+ player_state_e player_state = PLAYER_STATE_NONE;
+ ret = player_get_state(g_player[0], &player_state);
+ if (ret)
+ g_print("failed to player_get_state(), ret(0x%x)\n", ret);
+#ifdef NO_USE_CODE
+ reset_display();
#endif
- if (!g_win_id) {
- g_win_id = create_win(PACKAGE);
- if (g_win_id == NULL)
- return;
- g_print("create win_id %p\n", g_win_id);
- create_render_rect_and_bg(g_win_id);
- elm_win_activate(g_win_id);
- evas_object_show(g_win_id);
- g_win_id = selected_win_id;
- }
+ if (surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
#ifdef _ACTIVATE_EOM_
- } else {
- /* for external */
- }
+ hdmi_output_id = eom_get_output_id("HDMI");
+ if (hdmi_output_id == 0)
+ g_print("[eom] error : HDMI output id is NULL.\n");
+
+ eom_get_output_mode(hdmi_output_id, &output_mode);
+ if (output_mode == EOM_OUTPUT_MODE_NONE) {
#endif
- ret = player_set_display(g_player[0], surface_type, GET_DISPLAY(selected_win_id));
- } else {
if (!g_win_id) {
g_win_id = create_win(PACKAGE);
if (g_win_id == NULL)
create_render_rect_and_bg(g_win_id);
elm_win_activate(g_win_id);
evas_object_show(g_win_id);
+ g_win_id = selected_win_id;
}
+#ifdef _ACTIVATE_EOM_
+ } else {
+ /* for external */
+ }
+#endif
+ ret = player_set_display(g_player[0], surface_type, GET_DISPLAY(selected_win_id));
+ } else {
+ if (!g_win_id) {
+ g_win_id = create_win(PACKAGE);
+ if (g_win_id == NULL)
+ return;
+ g_print("create win_id %p\n", g_win_id);
+ create_render_rect_and_bg(g_win_id);
+ elm_win_activate(g_win_id);
+ evas_object_show(g_win_id);
+ }
+ if (surface_type == PLAYER_DISPLAY_TYPE_EVAS) {
+ /* surface type is PLAYER_DISPLAY_TYPE_NONE */
int i = 0;
for (i = 0; i < g_handle_num; i++) {
/* Create evas image object for EVAS surface */
ret = player_set_display(g_player[i], surface_type, g_eo[i]);
}
+ } else {
+ g_print("surface type is PLAYER_DISPLAY_TYPE_NONE\n");
}
- if (ret) {
- g_print("failed to set display, surface_type(%d)\n", surface_type);
- return;
- }
- g_current_surface_type = surface_type;
}
+ if (ret) {
+ g_print("failed to set display, surface_type(%d)\n", surface_type);
+ return;
+ }
+ g_current_surface_type = surface_type;
return;
}
g_print("failed to player_set_x11_display_visible\n");
}
-static void get_display_visible(bool * visible)
+static void get_display_visible(bool *visible)
{
player_is_display_visible(g_player[0], visible);
g_print(" ==> [Player_Test] Video Overlay Display Visible = %d\n", *visible);
strncpy(g_subtitle_uri, subtitle_filename, len);
g_print("subtitle uri is set to %s\n", g_subtitle_uri);
player_set_subtitle_path(g_player[0], g_subtitle_uri);
+ player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void *)g_player[0]);
}
-static void switch_subtitle(int index)
+static void set_track(int type, int index)
{
char *lang_code = NULL;
- if (player_select_track(g_player[0], PLAYER_STREAM_TYPE_TEXT, index) != PLAYER_ERROR_NONE)
+
+ if (player_select_track(g_player[0], type, index) != PLAYER_ERROR_NONE)
g_print("player_select_track failed\n");
- if (player_get_track_language_code(g_player[0], PLAYER_STREAM_TYPE_TEXT, index, &lang_code) == PLAYER_ERROR_NONE) {
- g_print("selected track code %s\n", lang_code);
+ if (player_get_track_language_code(g_player[0], type, index, &lang_code) == PLAYER_ERROR_NONE) {
+ g_print("selected track lang code %s\n", lang_code);
free(lang_code);
}
}
}
ret = player_get_track_count(g_player[0], index, &count);
- if (ret != PLAYER_ERROR_NONE)
+ if (ret != PLAYER_ERROR_NONE) {
g_print("player_get_track_count fail!!!!\n");
- else if (count) {
+ } else if (count) {
int idx = 0;
player_get_current_track(g_player[0], index, &cur_index);
g_print("total track: %d, curr track: %d\n", count, cur_index);
(player_audio_effect_set_equalizer_band_level(g_player[0], index / 2, max) != PLAYER_ERROR_NONE))
g_print("failed to player_audio_effect_set_equalizer_band_level index %d, level %d\n", index / 2, max);
}
- }
-
- else {
+ } else {
if (player_audio_effect_equalizer_clear(g_player[0]) != PLAYER_ERROR_NONE)
g_print("failed to player_audio_effect_equalizer_clear\n");
}
g_print(" ==> [Player_Test] eq bands frequency range: [%d] \n", value);
}
+static void video360_is_spherical(void)
+{
+ bool spherical;
+
+ if (player_360_is_content_spherical(g_player[0], &spherical) != PLAYER_ERROR_NONE)
+ g_print("failed to get content spherical info\n");
+ else
+ g_print(" ==> [Player_Test] Video 360 content = %s\n", spherical ? "spherical" : "---");
+
+}
+
static void video360_set_enable(bool enable)
{
+ bool enabled = false;
+
#ifdef USE_EVENT_HANDLER
event_handler_set_dov_fov();
#endif
- if (player_360_set_enable(g_player[0], enable) != PLAYER_ERROR_NONE)
+ if (player_360_set_enabled(g_player[0], enable) != PLAYER_ERROR_NONE)
g_print("failed to %s video 360 mode\n", enable ? "enable" : "disable");
+
+ if (player_360_is_enabled(g_player[0], &enabled) != PLAYER_ERROR_NONE)
+ g_print("failed to get video 360 mode status\n");
+ else
+ g_print(" ==> [Player_Test] Video 360 mode = %s\n", enabled ? "enabled" : "disabled");
}
-static void video360_get_enable()
+static void video360_get_fov()
{
- bool enable;
+ int hfov, vfov;
- if (player_360_is_enabled(g_player[0], &enable) != PLAYER_ERROR_NONE)
- g_print("failed to get video 360 mode status\n");
+ if (player_360_get_field_of_view(g_player[0], &hfov, &vfov) != PLAYER_ERROR_NONE)
+ g_print("failed to get video 360 field of view\n");
else
- g_print(" ==> [Player_Test] Video 360 mode = %s\n", enable ? "enabled" : "disabled");
+ g_print(" ==> [Player_Test] Video 360 FOV = %dx%d deg.\n", hfov, vfov);
}
static void video360_set_fov(int hfov, int vfov)
#endif
if (player_360_set_field_of_view(g_player[0], hfov, vfov) != PLAYER_ERROR_NONE)
g_print("failed to set video 360 field of view\n");
+
+ video360_get_fov();
}
-static void video360_get_fov()
+static void video360_get_dov()
{
- int hfov, vfov;
+ float yaw, pitch;
- if (player_360_get_field_of_view(g_player[0], &hfov, &vfov) != PLAYER_ERROR_NONE)
- g_print("failed to get video 360 field of view\n");
+ if (player_360_get_direction_of_view(g_player[0], &yaw, &pitch) != PLAYER_ERROR_NONE)
+ g_print("failed to get video 360 direction of view\n");
else
- g_print(" ==> [Player_Test] Video 360 FOV = %dx%d deg.\n", hfov, vfov);
+ g_print(" ==> [Player_Test] Video 360 DOV yaw = %d, pitch = %d deg.\n", (int)(yaw * 180.0f / M_PI), (int)(pitch * 180.0f / M_PI));
}
static void video360_set_dov(int yaw_deg, int pitch_deg)
#ifdef USE_EVENT_HANDLER
mm_navevent_handler_set_angles(event_handler, angles);
#endif
+
if (player_360_set_direction_of_view(g_player[0], angles[0], angles[1]) != PLAYER_ERROR_NONE)
g_print("failed to set video 360 direction of view\n");
+
+ video360_get_dov();
}
-static void video360_get_dov()
+static void video360_get_zoom()
{
- float yaw, pitch;
+ float zoom;
- if (player_360_get_direction_of_view(g_player[0], &yaw, &pitch) != PLAYER_ERROR_NONE)
- g_print("failed to get video 360 direction of view\n");
+ if (player_360_get_zoom(g_player[0], &zoom) != PLAYER_ERROR_NONE)
+ g_print("failed to get video 360 zoom\n");
else
- g_print(" ==> [Player_Test] Video 360 DOV yaw = %d, pitch = %d deg.\n", (int)(yaw * 180.0f / M_PI), (int)(pitch * 180.0f / M_PI));
+ g_print(" ==> [Player_Test] Video 360 zoom = %f\n", zoom);
}
static void video360_set_zoom(float zoom)
{
if (player_360_set_zoom(g_player[0], zoom) != PLAYER_ERROR_NONE)
g_print("failed to set video 360 zoom\n");
+
+ video360_get_zoom();
}
-static void video360_get_zoom()
+static void video360_set_zoom_with_fov(float zoom, int hfov, int vfov)
{
- float zoom;
+#ifdef USE_EVENT_HANDLER
+ mm_navevent_handler_size_s fov;
- if (player_360_get_zoom(g_player[0], &zoom) != PLAYER_ERROR_NONE)
- g_print("failed to get video 360 zoom\n");
- else
- g_print(" ==> [Player_Test] Video 360 zoom = %f\n", zoom);
+ fov.width = hfov;
+ fov.height = vfov;
+ mm_navevent_handler_set_fov_size(event_handler, fov);
+#endif
+ if (player_360_set_zoom_with_field_of_view(g_player[0], zoom, hfov, vfov) != PLAYER_ERROR_NONE)
+ g_print("failed to set video 360 zoom with field of view\n");
+
+ video360_get_fov();
+ video360_get_zoom();
+}
+
+static void set_replaygain_enabled(bool enabled)
+{
+ if (player_set_replaygain_enabled(g_player[0], enabled) != PLAYER_ERROR_NONE)
+ g_print("failed to set_replaygain_enabled\n");
+}
+
+static void is_replaygain_enabled(bool *enable)
+{
+ player_is_replaygain_enabled(g_player[0], enable);
+ g_print(" ==> [Player_Test] replaygain = %d\n", *enable);
+}
+
+static bool _supported_media_format_cb(media_format_mimetype_e format, void *user_data)
+{
+ g_print("- supported format mimetype 0x%X\n", format);
+ return true;
+}
+
+static void set_audio_offload_enabled(bool enabled)
+{
+ bool is_enabled = false;
+
+ player_audio_offload_is_enabled(g_player[0], &is_enabled);
+ g_print("[Player_Test] offload setting %d -> %d\n", is_enabled, enabled);
+
+ player_audio_offload_foreach_supported_format(g_player[0], _supported_media_format_cb, (void *)g_player[0]);
+
+ if (player_audio_offload_set_enabled(g_player[0], enabled) != PLAYER_ERROR_NONE)
+ g_print("failed to set audio offload\n");
+}
+
+static void pitch_set_enabled(bool enabled)
+{
+ bool is_enabled = false;
+ player_audio_pitch_is_enabled(g_player[0], &is_enabled);
+
+ g_print("pitch enabled %d -> %d \n", is_enabled, enabled);
+ if (player_audio_pitch_set_enabled(g_player[0], enabled) != PLAYER_ERROR_NONE)
+ g_print("failed to pitch_set_enabled\n");
+}
+
+static void pitch_set_value(float level)
+{
+ float curr = 0.0;
+ player_audio_pitch_get_value(g_player[0], &curr);
+
+ g_print("pitch level %1.3f -> %1.3f \n", curr, level);
+ if (player_audio_pitch_set_value(g_player[0], level) != PLAYER_ERROR_NONE)
+ g_print("failed to set pitch value\n");
}
#ifdef USE_EVENT_HANDLER
-static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void * data, float e[3])
+static void event_handler_cb(enum libinput_event_type ev_t, int x, int y, void *data, float e[3])
{
if (ev_t == LIBINPUT_EVENT_TOUCH_MOTION)
if (player_360_set_direction_of_view(g_player[0], e[0], e[1]) != PLAYER_ERROR_NONE)
player_get_display_rotation(g_player[0], &window_orientation);
elm_win_screen_size_get(selected_win_id, NULL, NULL, &window_size.width, &window_size.height);
- image_ratio = (float) image_size.width / (float) image_size.height;
+ image_ratio = (float)image_size.width / (float)image_size.height;
if (window_orientation == PLAYER_DISPLAY_ROTATION_NONE ||
window_orientation == PLAYER_DISPLAY_ROTATION_180) {
- window_size.height = (int)((float) window_size.width / image_ratio);
+ window_size.height = (int)((float)window_size.width / image_ratio);
} else {
window_size.height = window_size.width;
- window_size.width = (int)((float) window_size.width * image_ratio);
+ window_size.width = (int)((float)window_size.width * image_ratio);
}
mm_navevent_handler_set_window_parameters(event_handler,
- (mm_navevent_handler_orientation_e) window_orientation, window_size);
+ (mm_navevent_handler_orientation_e)window_orientation, window_size);
}
#endif
float left;
float right;
get_volume(&left, &right);
- } else if (strncmp(cmd, "z", 1) == 0) {
- g_menu_state = CURRENT_STATUS_SOUND_TYPE;
} else if (strncmp(cmd, "k", 1) == 0) {
g_menu_state = CURRENT_STATUS_SOUND_STREAM_INFO;
} else if (strncmp(cmd, "h", 1) == 0) {
if (g_current_surface_type == -1) {
g_print("You must set display surface type before setting prepare. please 'pr' after setting display surface type.\n");
g_menu_state = CURRENT_STATUS_DISPLAY_SURFACE_CHANGE;
- } else
- _player_prepare(TRUE);
+ } else {
+ _player_prepare(TRUE);
+ }
} else if (strncmp(cmd, "un", 2) == 0) {
_player_unprepare();
} else if (strncmp(cmd, "dt", 2) == 0) {
_player_destroy();
- } else if (strncmp(cmd, "sp", 2) == 0) {
- _player_set_progressive_download();
- } else if (strncmp(cmd, "gp", 2) == 0) {
- _player_get_progressive_download_status();
} else if (strncmp(cmd, "mp", 2) == 0) {
g_memory_playback = (g_memory_playback ? FALSE : TRUE);
g_print("memory playback = %d\n", g_memory_playback);
} else if (strncmp(cmd, "ds", 2) == 0) {
g_menu_state = CURRENT_STATUS_DISPLAY_SURFACE_CHANGE;
} else if (strncmp(cmd, "dr", 2) == 0) {
- g_print("now, PLAYER_DISPLAY_MODE_DST_ROI(display mode) is set\n");
- g_menu_state = CURRENT_STATUS_DISPLAY_DST_ROI;
+ g_menu_state = CURRENT_STATUS_DISPLAY_DST_ROI_AREA;
} else if (strncmp(cmd, "nb", 2) == 0) {
g_menu_state = CURRENT_STATUS_HANDLE_NUM;
} else if (strncmp(cmd, "tr", 2) == 0) {
g_menu_state = CURRENT_STATUS_PLAYBACK_RATE;
- } else if (strncmp(cmd, "ss", 2) == 0) {
- g_menu_state = CURRENT_STATUS_SWITCH_SUBTITLE;
- } else if (strncmp(cmd, "X3", 2) == 0) {
- audio_frame_decoded_cb_ex(TRUE);
- } else if (strncmp(cmd, "X4", 2) == 0) {
- audio_frame_decoded_cb_ex(FALSE);
+ } else if (strncmp(cmd, "X5", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_EXPORT_PCM_OPTION;
} else if (strncmp(cmd, "ep", 2) == 0) {
_player_enable_tsurf_pool();
} else if (strncmp(cmd, "su", 2) == 0) {
get_next_uri();
} else if (strncmp(cmd, "sg", 2) == 0) {
g_menu_state = CURRENT_STATUS_GAPLESS;
- } else if (strncmp(cmd, "tl", 2) == 0) {
+ } else if (strncmp(cmd, "tg", 2) == 0) {
g_menu_state = CURRENT_STATUS_GET_TRACK_INFO;
+ } else if (strncmp(cmd, "ts", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_SET_TRACK_TYPE;
} else if (strncmp(cmd, "vi", 2) == 0) {
get_variant_info();
} else if (strncmp(cmd, "vs", 2) == 0) {
} else if (strncmp(cmd, "bf", 2) == 0) {
g_menu_state = CURRENT_STATUS_SET_PRE_BUFFERING_SIZE;
} else if (strncmp(cmd, "C1", 2) == 0) {
- g_menu_state = CURRENT_STATUS_AUDIO_CODEC_TYPE;
+ g_menu_state = CURRENT_STATUS_VIDEO_CODEC_TYPE;
} else if (strncmp(cmd, "C2", 2) == 0) {
get_codec_type();
+ } else if (!strncmp(cmd, "si", 2)) {
+ video360_is_spherical();
+ } else if (!strncmp(cmd, "se", 2)) {
+ g_menu_state = CURRENT_STATUS_VIDEO360_SET_ENABLE;
+ } else if (!strncmp(cmd, "sd", 2)) {
+ g_menu_state = CURRENT_STATUS_VIDEO360_SET_DOV;
+ } else if (!strncmp(cmd, "sf", 2)) {
+ g_menu_state = CURRENT_STATUS_VIDEO360_SET_FOV;
+ } else if (!strncmp(cmd, "sz", 2)) {
+ g_menu_state = CURRENT_STATUS_VIDEO360_SET_ZOOM;
+ } else if (strncmp(cmd, "lb", 2) == 0) {
+ get_buffering_position();
+ } else if (strncmp(cmd, "ol", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_AUDIO_OFFLOAD;
+ } else if (strncmp(cmd, "pc", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_PITCH_CONTROL;
+ } else if (strncmp(cmd, "pv", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_PITCH_VALUE;
} else {
g_print("unknown menu \n");
}
} else if (len == 3) {
- if (strncmp(cmd, "trs", 3) == 0)
+ if (strncmp(cmd, "trs", 3) == 0) {
g_menu_state = CURRENT_STATUS_STREAMING_PLAYBACK_RATE;
- else
- g_print("unknown menu \n");
- } else if (len == 4) {
- if (!strncmp(cmd, "v3se", 4))
- g_menu_state = CURRENT_STATUS_VIDEO360_SET_ENABLE;
- else if (!strncmp(cmd, "v3ge", 4))
- video360_get_enable();
- else if (!strncmp(cmd, "v3sd", 4))
- g_menu_state = CURRENT_STATUS_VIDEO360_SET_DOV;
- else if (!strncmp(cmd, "v3gd", 4))
- video360_get_dov();
- else if (!strncmp(cmd, "v3sf", 4))
- g_menu_state = CURRENT_STATUS_VIDEO360_SET_FOV;
- else if (!strncmp(cmd, "v3gf", 4))
- video360_get_fov();
- else if (!strncmp(cmd, "v3sz", 4))
- g_menu_state = CURRENT_STATUS_VIDEO360_SET_ZOOM;
- else if (!strncmp(cmd, "v3gz", 4))
- video360_get_zoom();
- else
+ } else if (strncmp(cmd, "rgs", 3) == 0) {
+ g_menu_state = CURRENT_STATUS_REPLAYGAIN_ENABLE;
+ } else if (strncmp(cmd, "rgg", 3) == 0) {
+ bool enable;
+ is_replaygain_enabled(&enable);
+ } else if (!strncmp(cmd, "szz", 3)) {
+ g_menu_state = CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV;
+ } else {
g_print("unknown menu \n");
- } else
+ }
+ } else {
g_print("unknown menu \n");
+ }
}
void display_sub_basic()
g_print("[audio eq] E. Set Audio EQ\t");
g_print("H. Get Audio EQ\n");
g_print("[position] j. Set Position \t");
- g_print("l. Get Position\n");
+ g_print("l. Get Position\t");
+ g_print("lb. Get buffering position\n");
g_print("[trick] tr. set playback rate\n");
g_print("[duration] m. Get Duration\n");
g_print("[Stream Info] n. Get stream info (Video Size, codec, audio stream info, and tag info)\n");
g_print("[overlay display] r. Set display mode\t");
g_print("s. Get display mode\n");
g_print("[overlay display] t. Set display Rotation\n");
- g_print("[Track] tl. Get Track language info(single only)\n");
g_print("[Variant] vi. Get Streaming Variant Info\t");
g_print("vs. Set max limit of variant\t");
g_print("vg. Get max limit of variant\n");
g_print("[audio only] ao. set audio only\n");
g_print("[subtitle] A. Set(or change) subtitle path\n");
- g_print("[subtitle] ss. Select(or change) subtitle track\n");
+ g_print("[Track] tg. Get Track info\n");
+ g_print("[Track] ts. Set track\n");
g_print("[Video Capture] C. Capture \n");
- g_print("[Video Codec] C1. Set vcodec type (1:HW, 2:SW)\t");
- g_print("C2. Get vcodec type\n");
+ g_print("[Video Codec] C1. Set codec type (1:HW, 2:SW)\t");
+ g_print("C2. Get codec type\n");
g_print("[next uri] su. set next uri. \t");
g_print("gu. get next uri. \t");
g_print("sg. set gapless. \n");
- g_print("[audio_frame_decoded_cb_ex] X3. set audio_cb with sync\t");
- g_print("X4. set audio_cb with async \n");
+ g_print("[audio_frame_decoded_cb] X5. set audio decoded cb\n");
g_print("[video_frame_decoded_cb] ep. enable tbm surface pool\n");
g_print("[buffering] bf. set new buffering size\n");
- g_print("[Video 360] v3se. Set Enable\t\t");
- g_print("v3ge. Get Enable\n");
- g_print("[Video 360] v3sd. Set Direction Of View\t");
- g_print("v3gd. Get Direction Of View\n");
- g_print("[Video 360] v3sf. Set Field Of View\t");
- g_print("v3gf. Get Field Of View\n");
- g_print("[Video 360] v3sz. Set Zoom\t\t");
- g_print("v3gz. Get Zoom\n");
+ g_print("[Video 360] si. check spherical info\t");
+ g_print("se. Set Enable\n");
+ g_print("[Video 360] sd. Set Direction Of View\t");
+ g_print("sf. Set Field Of View\n");
+ g_print("[Video 360] sz. Set Zoom\t\t");
+ g_print("szz. Set Zoom with FOV\n");
+ g_print("[Replaygain] rgs. Set Replaygain\t\t");
+ g_print("rgg. Get replaygain\n");
+ g_print("[Offload] ol. Set audio offload\n");
+ g_print("[pitch] pc. enable pitch control\t");
+ g_print("pv. Set pitch value\n");
g_print("[etc] sp. Set Progressive Download\t");
g_print("gp. Get Progressive Download status\t");
g_print("mp. memory playback\n");
g_print("*** input mediapath.\n");
} else if (g_menu_state == CURRENT_STATUS_VOLUME) {
g_print("*** input volume value.(0~1.0)\n");
- } else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE) {
- g_print("*** input sound type.(0:SYSTEM 1:NOTIFICATION 2:ALARM 3:RINGTONE 4:MEDIA 5:CALL 6:VOIP 7:FIXED)\n");
} else if (g_menu_state == CURRENT_STATUS_SOUND_STREAM_INFO) {
g_print("*** input sound stream type.(0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:EMERGENCY 5:VOICE_INFORMATION 9:MEDIA_EXT_ONLY)\n");
} else if (g_menu_state == CURRENT_STATUS_MUTE) {
g_print("*** input looping value.(0: Not Looping, 1: Looping) \n");
} else if (g_menu_state == CURRENT_STATUS_DISPLAY_SURFACE_CHANGE) {
g_print("*** input display surface type.(0: Wayland surface, 1: EVAS surface, 2: No use surface (e.g: audio playback)) \n");
+ } else if (g_menu_state == CURRENT_STATUS_EXPORT_VIDEO_FRAME) {
+ g_print("*** set video_decoded_cb (0: none, 1: set cb) \n");
} else if (g_menu_state == CURRENT_STATUS_DISPLAY_MODE) {
- g_print("*** input display mode value.(0: LETTER BOX, 1: ORIGIN SIZE, 2: FULL_SCREEN, 3: CROPPED_FULL, 4: ORIGIN_OR_LETTER) \n");
- } else if (g_menu_state == CURRENT_STATUS_DISPLAY_DST_ROI) {
+ g_print("*** input display mode value.(0: LETTER BOX, 1: ORIGIN SIZE, 2: FULL_SCREEN, 3: CROPPED_FULL, 4: ORIGIN_OR_LETTER, 5:ROI) \n");
+ } else if (g_menu_state == CURRENT_STATUS_DISPLAY_DST_ROI_AREA) {
g_print("*** input display roi value sequentially.(x, y, w, h)\n");
} else if (g_menu_state == CURRENT_STATUS_DISPLAY_ROTATION) {
g_print("*** input display rotation value.(0: NONE, 1: 90, 2: 180, 3: 270, 4:F LIP_HORZ, 5: FLIP_VERT ) \n");
g_print(" *** input audio eq value.(0: UNSET, 1: SET) \n");
} else if (g_menu_state == CURRENT_STATUS_PLAYBACK_RATE || g_menu_state == CURRENT_STATUS_STREAMING_PLAYBACK_RATE) {
g_print(" *** input playback rate.(-5.0 ~ 5.0)\n");
- } else if (g_menu_state == CURRENT_STATUS_SWITCH_SUBTITLE) {
- int count = 0, cur_index = 0;
- int ret = 0;
-
- ret = player_get_track_count(g_player[0], PLAYER_STREAM_TYPE_TEXT, &count);
- if (ret != PLAYER_ERROR_NONE)
- g_print("player_get_track_count fail!!!!\n");
- else if (count) {
- g_print("Total subtitle tracks = %d \n", count);
- player_get_current_track(g_player[0], PLAYER_STREAM_TYPE_TEXT, &cur_index);
- g_print("Current index = %d \n", cur_index);
- g_print(" *** input correct index 0 to %d\n:", (count - 1));
- } else
- g_print("no track\n");
+ } else if (g_menu_state == CURRENT_STATUS_SET_TRACK_TYPE) {
+ g_print(" *** input track type.(1:audio, 3:text)\n");
+ } else if (g_menu_state == CURRENT_STATUS_SET_TRACK_INDEX) {
+ g_print(" *** input track index\n");
} else if (g_menu_state == CURRENT_STATUS_NEXT_URI) {
g_print("*** input next uri.\n");
} else if (g_menu_state == CURRENT_STATUS_GAPLESS) {
g_print("*** input gapless value.(0:disable, 1: enable) \n");
} else if (g_menu_state == CURRENT_STATUS_GET_TRACK_INFO) {
- g_print("*** input stream type.(1:audio, 3:text) \n");
+ g_print("*** input track type.(1:audio, 3:text) \n");
} else if (g_menu_state == CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT) {
g_print("*** set max bandwidth (default: -1) \n");
} else if (g_menu_state == CURRENT_STATUS_SET_MAX_WIDTH_VARIANT) {
g_print("*** input vertical field of view angle (1~180 deg.)\n");
} else if (g_menu_state == CURRENT_STATUS_VIDEO360_SET_ZOOM) {
g_print("*** input zoom factor.(1.0~10.0, where 1.0 - no zoom, actual image) \n");
- } else if (g_menu_state == CURRENT_STATUS_AUDIO_CODEC_TYPE) {
- g_print("*** set audio codec type (1: HW, 2: SW) \n");
+ } else if (g_menu_state == CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV) {
+ g_print("*** input zoom factor.(1.0~10.0, where 1.0 - no zoom, actual image) \n");
+ } else if (g_menu_state == CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV1) {
+ g_print("*** input horizontal field of view angle (1~360 deg.)\n");
+ } else if (g_menu_state == CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV2) {
+ g_print("*** input vertical field of view angle (1~180 deg.)\n");
} else if (g_menu_state == CURRENT_STATUS_VIDEO_CODEC_TYPE) {
g_print("*** set video codec type (1: HW, 2: SW) \n");
+ } else if (g_menu_state == CURRENT_STATUS_REPLAYGAIN_ENABLE) {
+ g_print("*** input replaygain value.(0:disable, 1: enable) \n");
+ } else if (g_menu_state == CURRENT_STATUS_AUDIO_OFFLOAD) {
+ g_print("*** input audio offload value.(0:disable, 1: enable) \n");
+ } else if (g_menu_state == CURRENT_STATUS_PITCH_CONTROL) {
+ g_print("*** input pitch control value.(0:disable, 1: enable) \n");
+ } else if (g_menu_state == CURRENT_STATUS_PITCH_VALUE) {
+ g_print("*** input pitch value.(0.5 ~ 2) \n");
+ } else if (g_menu_state == CURRENT_STATUS_EXPORT_PCM_OPTION) {
+ g_print("*** set option (0~3) \n");
+ } else if (g_menu_state == CURRENT_STATUS_EXPORT_PCM_CH) {
+ g_print("*** set pcm channel (e.g. 2)\n");
+ } else if (g_menu_state == CURRENT_STATUS_EXPORT_PCM_RATE) {
+ g_print("*** set pcm samplerate (e.g. 44100)\n");
+ } else if (g_menu_state == CURRENT_STATUS_EXPORT_PCM_MIME) {
+ g_print("*** set pcm mime (e.g. S16LE) \n");
} else {
g_print("*** unknown status.\n");
quit_program();
static void interpret(char *cmd)
{
- static int value1, value2;
+ static int value1 = 0, value2 = 0, value3 = 0;
+ static float fval = 0.0;
switch (g_menu_state) {
case CURRENT_STATUS_MAINMENU:
break;
case CURRENT_STATUS_HANDLE_NUM:
{
- int num_handle = atoi(cmd);
- if (0 >= num_handle || num_handle > MAX_HANDLE)
- g_print("not supported this number for handles(%d)\n", num_handle);
+ value1 = atoi(cmd);
+ if (0 >= value1 || value1 > MAX_HANDLE)
+ g_print("not supported this number for handles(%d)\n", value1);
else
- g_handle_num = num_handle;
+ g_handle_num = value1;
reset_menu_state();
}
break;
case CURRENT_STATUS_VOLUME:
{
- float level = atof(cmd);
- set_volume(level);
- reset_menu_state();
- }
- break;
- case CURRENT_STATUS_SOUND_TYPE:
- {
- int type = atoi(cmd);
- set_sound_type(type);
+ fval = atof(cmd);
+ set_volume(fval);
reset_menu_state();
}
break;
case CURRENT_STATUS_SOUND_STREAM_INFO:
{
- int type = atoi(cmd);
- set_sound_stream_info(type);
+ value1 = atoi(cmd);
+ set_sound_stream_info(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_MUTE:
{
- int mute = atoi(cmd);
- set_mute(mute);
+ value1 = atoi(cmd);
+ set_mute(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_POSITION_TIME:
{
- seek_info.pos = atoi(cmd);
+ value1 = atoi(cmd);
g_menu_state = CURRENT_STATUS_POSITION_ACCURATE;
}
break;
case CURRENT_STATUS_POSITION_ACCURATE:
{
- seek_info.accurate = (atoi(cmd) != 0) ? (true) : (false);
- set_position(seek_info.pos, seek_info.accurate);
+ set_position(value1, ((atoi(cmd) != 0) ? (true) : (false)));
reset_menu_state();
}
break;
case CURRENT_STATUS_LOOPING:
{
- int looping = atoi(cmd);
- set_looping(looping);
+ value1 = atoi(cmd);
+ set_looping(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_GAPLESS:
{
- int gapless = atoi(cmd);
- set_gapless(gapless);
+ value1 = atoi(cmd);
+ set_gapless(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_DISPLAY_SURFACE_CHANGE:
{
- int type = atoi(cmd);
- change_surface(type);
+ value1 = atoi(cmd);
+ change_surface(value1);
+ if (value1 == 2) { /* null display type */
+ g_menu_state = CURRENT_STATUS_EXPORT_VIDEO_FRAME;
+ break;
+ }
reset_menu_state();
}
break;
+ case CURRENT_STATUS_EXPORT_VIDEO_FRAME:
+ {
+ value2 = atoi(cmd);
+ if (value2 != 0)
+ set_video_frame_decoded_cb();
+ reset_menu_state();
+ } break;
case CURRENT_STATUS_DISPLAY_MODE:
{
- int mode = atoi(cmd);
- set_display_mode(mode);
+ value1 = atoi(cmd);
+ set_display_mode(value1);
reset_menu_state();
}
break;
- case CURRENT_STATUS_DISPLAY_DST_ROI:
+ case CURRENT_STATUS_DISPLAY_DST_ROI_AREA:
{
- int value = atoi(cmd);
+ value1 = atoi(cmd);
static int x = 0;
static int y = 0;
static int w = 0;
static int h = 0;
static int cnt = 0;
- set_display_mode(PLAYER_DISPLAY_MODE_DST_ROI);
switch (cnt) {
case 0:
- x = value;
+ x = value1;
cnt++;
break;
case 1:
- y = value;
+ y = value1;
cnt++;
break;
case 2:
- w = value;
+ w = value1;
cnt++;
break;
case 3:
cnt = 0;
- h = value;
+ h = value1;
set_display_roi_area(x, y, w, h);
x = y = w = h = 0;
reset_menu_state();
break;
case CURRENT_STATUS_DISPLAY_ROTATION:
{
- int rotation = atoi(cmd);
- set_display_rotation(rotation);
+ value1 = atoi(cmd);
+ set_display_rotation(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_DISPLAY_VISIBLE:
{
- int visible = atoi(cmd);
- set_display_visible(visible);
+ value1 = atoi(cmd);
+ set_display_visible(value1);
reset_menu_state();
}
break;
break;
case CURRENT_STATUS_AUDIO_EQUALIZER:
{
- int value = atoi(cmd);
- set_audio_eq(value);
+ value1 = atoi(cmd);
+ set_audio_eq(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_PLAYBACK_RATE:
{
- float rate = atof(cmd);
- set_playback_rate(rate, FALSE);
+ fval = atof(cmd);
+ set_playback_rate(fval, FALSE);
reset_menu_state();
}
break;
case CURRENT_STATUS_STREAMING_PLAYBACK_RATE:
{
- float rate = atof(cmd);
- set_playback_rate(rate, TRUE);
+ fval = atof(cmd);
+ set_playback_rate(fval, TRUE);
reset_menu_state();
}
break;
- case CURRENT_STATUS_SWITCH_SUBTITLE:
+ case CURRENT_STATUS_SET_TRACK_TYPE:
+ {
+ value1 = atoi(cmd);
+ get_track_info(value1);
+
+ g_menu_state = CURRENT_STATUS_SET_TRACK_INDEX;
+ }
+ break;
+ case CURRENT_STATUS_SET_TRACK_INDEX:
{
- int index = atoi(cmd);
- switch_subtitle(index);
+ value2 = atoi(cmd);
+ set_track(value1, value2);
reset_menu_state();
}
break;
break;
case CURRENT_STATUS_GET_TRACK_INFO:
{
- int index = atoi(cmd);
- get_track_info(index);
+ value1 = atoi(cmd);
+ get_track_info(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT:
{
- int value = atoi(cmd);
- max_limit.bandwidth = value;
+ value1 = atoi(cmd);
g_menu_state = CURRENT_STATUS_SET_MAX_WIDTH_VARIANT;
}
break;
case CURRENT_STATUS_SET_MAX_WIDTH_VARIANT:
{
- int value = atoi(cmd);
- max_limit.width = value;
+ value2 = atoi(cmd);
g_menu_state = CURRENT_STATUS_SET_MAX_HEIGHT_VARIANT;
}
break;
case CURRENT_STATUS_SET_MAX_HEIGHT_VARIANT:
{
- int value = atoi(cmd);
- max_limit.height = value;
- set_variant_limit();
+ value3 = atoi(cmd);
+ set_variant_limit(value1, value2, value3);
reset_menu_state();
}
break;
case CURRENT_STATUS_SET_AUDIO_ONLY:
{
- int value = atoi(cmd);
- set_audio_only(value);
+ value1 = atoi(cmd);
+ set_audio_only(value1);
reset_menu_state();
}
break;
case CURRENT_STATUS_SET_PRE_BUFFERING_SIZE:
{
- int value = atoi(cmd);
- buff_size.buffer_ms = value;
+ value1 = atoi(cmd);
g_menu_state = CURRENT_STATUS_SET_RE_BUFFERING_SIZE;
}
break;
case CURRENT_STATUS_SET_RE_BUFFERING_SIZE:
{
- int value = atoi(cmd);
- buff_size.rebuffer_ms = value;
- set_buffer_size();
+ value2 = atoi(cmd);
+ set_buffer_size(value1, value2);
reset_menu_state();
}
break;
case CURRENT_STATUS_VIDEO360_SET_ENABLE:
{
- int enable = atoi(cmd);
- video360_set_enable(enable);
+ value1 = atoi(cmd);
+ video360_set_enable(value1);
reset_menu_state();
}
break;
break;
case CURRENT_STATUS_VIDEO360_SET_ZOOM:
{
- float zoom = atof(cmd);
- video360_set_zoom(zoom);
+ fval = atof(cmd);
+ video360_set_zoom(fval);
reset_menu_state();
}
break;
- case CURRENT_STATUS_AUDIO_CODEC_TYPE:
+ case CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV:
{
- int value = atoi(cmd);
- codec_type.a_codec_type = value;
- g_menu_state = CURRENT_STATUS_VIDEO_CODEC_TYPE;
+ fval = atof(cmd);
+ g_menu_state = CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV1;
+ }
+ break;
+ case CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV1:
+ {
+ value1 = atoi(cmd);
+ g_menu_state = CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV2;
+ }
+ break;
+ case CURRENT_STATUS_VIDEO360_SET_ZOOM_WITH_FOV2:
+ {
+ value2 = atoi(cmd);
+ video360_set_zoom_with_fov(fval, value1, value2);
+ reset_menu_state();
}
break;
case CURRENT_STATUS_VIDEO_CODEC_TYPE:
{
- int value = atoi(cmd);
- codec_type.v_codec_type = value;
- set_codec_type();
+ value1 = atoi(cmd);
+ set_video_codec_type(value1);
+ reset_menu_state();
+ }
+ break;
+ case CURRENT_STATUS_REPLAYGAIN_ENABLE:
+ {
+ value1 = atoi(cmd);
+ set_replaygain_enabled(value1);
+ reset_menu_state();
+ }
+ break;
+ case CURRENT_STATUS_AUDIO_OFFLOAD:
+ {
+ value1 = atoi(cmd);
+ set_audio_offload_enabled(value1);
+ reset_menu_state();
+ }
+ break;
+ case CURRENT_STATUS_PITCH_CONTROL:
+ {
+ value1 = atoi(cmd);
+ pitch_set_enabled(value1);
+ reset_menu_state();
+ }
+ break;
+ case CURRENT_STATUS_PITCH_VALUE:
+ {
+ fval = atof(cmd);
+ pitch_set_value(fval);
+ reset_menu_state();
+ }
+ break;
+ case CURRENT_STATUS_EXPORT_PCM_OPTION:
+ {
+ value1 = atoi(cmd);
+ g_menu_state = CURRENT_STATUS_EXPORT_PCM_CH;
+ }
+ break;
+ case CURRENT_STATUS_EXPORT_PCM_CH:
+ {
+ value2 = atoi(cmd);
+ g_menu_state = CURRENT_STATUS_EXPORT_PCM_RATE;
+ }
+ break;
+ case CURRENT_STATUS_EXPORT_PCM_RATE:
+ {
+ value3 = atoi(cmd);
+ g_menu_state = CURRENT_STATUS_EXPORT_PCM_MIME;
+ }
+ break;
+ case CURRENT_STATUS_EXPORT_PCM_MIME:
+ {
+ set_audio_frame_decoded_cb((player_audio_extract_option_e)value1, cmd, value2, value3);
reset_menu_state();
}
break;
g_timeout_add(100, timeout_menu_display, 0);
}
-gboolean input(GIOChannel * channel)
+gboolean input(GIOChannel *channel)
{
gchar buf[MAX_STRING_LEN];
gsize read;
GIOChannel *stdin_channel;
stdin_channel = g_io_channel_unix_new(0);
g_io_channel_set_flags(stdin_channel, G_IO_FLAG_NONBLOCK, NULL);
- g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc) input, NULL);
+ g_io_add_watch(stdin_channel, G_IO_IN, (GIOFunc)input, NULL);
displaymenu();
memset(&ad, 0x0, sizeof(appdata));