Changeset 30698


Ignore:
Timestamp:
10/25/14 13:12:34 (9 years ago)
Author:
obi
Message:

[mipsel] add changedvbdev after hyprid tuner switch

Location:
titan/titan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/dvbdev.h

    r30686 r30698  
    112112                if(fehyprid != NULL)
    113113                {
    114 //                      if(y < 10)
    115 //                              tmpstr = ostrcat(tmpstr, "fe_0", 1, 0);
    116 //                      else
     114                        if(node->adapter < 10)
     115                                tmpstr = ostrcat(tmpstr, "fe_0", 1, 0);
     116                        else
    117117                                tmpstr = ostrcat(tmpstr, "fe_1", 1, 0);
    118118
  • titan/titan/player.h

    r30678 r30698  
    810810//              status.prefillbuffer = 1;
    811811
     812//analyze_streams(data);
     813
    812814                int count = 0;
    813815                m_gst_startpts = 0;
     
    838840{
    839841#ifdef EPLAYER4
     842//      GstBus *bus;
     843//      GstStateChangeReturn ret;
     844//      gint flags;
    840845        gst_init(&argc, &argv);
    841846#endif
     
    845850int gstbuscall(GstBus *bus, GstMessage *msg, CustomData *data)
    846851{
    847 
    848852        int ret = 1;
    849853        if(!pipeline) return 0;
     
    863867                        break;
    864868                case GST_MESSAGE_STATE_CHANGED:
     869                        debug(150, "gst message state changed");
    865870                        if(GST_MESSAGE_SRC(msg) != GST_OBJECT(pipeline))
    866                                 break;
    867 
    868                         GstState old_state, new_state;
    869                         gst_message_parse_state_changed(msg, &old_state, &new_state, NULL);
    870                
     871                                break;
     872
     873                        GstState old_state, new_state, pending_state;
     874                        gst_message_parse_state_changed(msg, &old_state, &new_state, &pending_state);
     875                        if(GST_MESSAGE_SRC(msg) == GST_OBJECT(pipeline))
     876                        {
     877                                if(new_state == GST_STATE_PLAYING)
     878                                {
     879                                        /* Once we are in the playing state, analyze the streams */
     880                                        analyze_streams(data);
     881                                }
     882                        }
     883
    871884                        if(old_state == new_state) break;
    872885       
     
    24022415}
    24032416
    2404 #endif
     2417#ifdef EPLAYER4
     2418/* Extract some metadata from the streams and print it on the screen */
     2419static void analyze_streams(CustomData *data)
     2420{
     2421        gint i;
     2422        GstTagList *tags;
     2423        gchar *str;
     2424        guint rate;
     2425
     2426        /* Read some properties */
     2427        g_object_get(pipeline, "n-video", &data->n_video, NULL);
     2428        g_object_get(pipeline, "n-audio", &data->n_audio, NULL);
     2429        g_object_get(pipeline, "n-text", &data->n_text, NULL);
     2430
     2431        g_print("%d video stream(s), %d audio stream(s), %d text stream(s)\n", data->n_video, data->n_audio, data->n_text);
     2432
     2433        g_print ("\n");
     2434        for(i = 0; i < data->n_video; i++)
     2435        {
     2436                tags = NULL;
     2437                /* Retrieve the stream's video tags */
     2438                g_signal_emit_by_name(pipeline, "get-video-tags", i, &tags);
     2439                if(tags)
     2440                {
     2441                        g_print("video stream %d:\n", i);
     2442                        gst_tag_list_get_string(tags, GST_TAG_VIDEO_CODEC, &str);
     2443                        g_print("  codec: %s\n", str ? str : "unknown");
     2444                        g_free(str);
     2445                        gst_tag_list_free(tags);
     2446                }
     2447        }
     2448
     2449        g_print("\n");
     2450        for(i = 0; i < data->n_audio; i++)
     2451        {
     2452                tags = NULL;
     2453                g_signal_emit_by_name(pipeline, "get-audio-tags", i, &tags);
     2454                if(tags)
     2455                {
     2456                        /* Retrieve the stream's audio tags */
     2457                        g_print("audio stream %d:\n", i);
     2458                        if(gst_tag_list_get_string (tags, GST_TAG_AUDIO_CODEC, &str))
     2459                        {
     2460                                g_print("  codec: %s\n", str);
     2461                                g_free(str);
     2462                        }
     2463                        if(gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str))
     2464                        {
     2465                                g_print("  language: %s\n", str);
     2466                                g_free(str);
     2467                        }
     2468                        if(gst_tag_list_get_uint (tags, GST_TAG_BITRATE, &rate))
     2469                        {
     2470                                g_print("  bitrate: %d\n", rate);
     2471                        }
     2472                        gst_tag_list_free(tags);
     2473                }
     2474        }
     2475
     2476        g_print("\n");
     2477        for(i = 0; i < data->n_text; i++)
     2478        {
     2479                tags = NULL;
     2480                /* Retrieve the stream's subtitle tags */
     2481                g_print("subtitle stream %d:\n", i);
     2482                g_signal_emit_by_name(pipeline, "get-text-tags", i, &tags);
     2483                if(tags)
     2484                {
     2485                        if(gst_tag_list_get_string (tags, GST_TAG_LANGUAGE_CODE, &str))
     2486                        {
     2487                                g_print("  language: %s\n", str);
     2488                                g_free(str);
     2489                        }
     2490                        gst_tag_list_free(tags);
     2491                }
     2492                else
     2493                {
     2494                        g_print("  no tags found\n");
     2495                }
     2496        }
     2497
     2498        g_object_get(pipeline, "current-video", &data->current_video, NULL);
     2499        g_object_get(pipeline, "current-audio", &data->current_audio, NULL);
     2500        g_object_get(pipeline, "current-text", &data->current_text, NULL);
     2501
     2502        g_print("\n");
     2503        g_print("Currently playing video stream %d, audio stream %d and subtitle stream %d\n", data->current_video, data->current_audio, data->current_text);
     2504        g_print("Type any number and hit ENTER to select a different subtitle stream\n");
     2505}
     2506#endif
     2507
     2508#endif
  • titan/titan/struct.h

    r30678 r30698  
    19061906typedef enum {atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC, atWMA} audiotype_t;
    19071907typedef struct _CustomData {
     1908  GstElement *playbin2;  /* Our one and only element */
     1909   
     1910  gint n_video;          /* Number of embedded video streams */
     1911  gint n_audio;          /* Number of embedded audio streams */
     1912  gint n_text;           /* Number of embedded subtitle streams */
     1913   
     1914  gint current_video;    /* Currently playing video stream */
     1915  gint current_audio;    /* Currently playing audio stream */
     1916  gint current_text;     /* Currently playing subtitle stream */
     1917
    19081918  gboolean is_live;
    19091919  GstElement *pipeline;
    19101920  GMainLoop *loop;
    19111921} CustomData;
     1922
     1923typedef enum {
     1924        GST_PLAY_FLAG_VIDEO = (1 << 0),
     1925        GST_PLAY_FLAG_AUDIO = (1 << 1),
     1926        GST_PLAY_FLAG_TEXT = (1 << 2),
     1927        GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 3)
     1928} GstPlayFlags;
    19121929#endif
    19131930
Note: See TracChangeset for help on using the changeset viewer.