Changeset 30678
- Timestamp:
- 10/24/14 19:38:56 (8 years ago)
- Location:
- titan/titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/player.h
r30671 r30678 31 31 GstElement *pipeline = NULL; 32 32 unsigned long long m_gst_startpts = 0; 33 CustomData data; 33 34 #endif 34 35 … … 591 592 } 592 593 593 #ifdef EPLAYER4594 typedef struct _CustomData {595 gboolean is_live;596 GstElement *pipeline;597 GMainLoop *loop;598 } CustomData;599 600 CustomData data;601 #endif602 603 594 //extern player 604 595 int playerstart(char* file) … … 766 757 } 767 758 759 //gpointer this; 760 //memset (&this, 0, sizeof (this)); 761 768 762 GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); 769 763 #if GST_VERSION_MAJOR < 1 770 764 // gst_bus_set_sync_handler(bus, gstBusSyncHandler, this); 771 gst_bus_set_sync_handler(bus, NULL, NULL);765 gst_bus_set_sync_handler(bus, GST_BUS_DROP, NULL); 772 766 #else 773 767 // gst_bus_set_sync_handler(bus, gstBusSyncHandler, this, NULL); 774 gst_bus_set_sync_handler(bus, NULL, NULL, NULL);768 gst_bus_set_sync_handler(bus, GST_BUS_DROP, NULL, NULL); 775 769 #endif 776 770 … … 831 825 return 1; 832 826 } 833 834 827 835 828 #ifdef EPLAYER4 … … 1384 1377 1385 1378 #ifdef EPLAYER4 1386 typedef enum {atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC, atWMA} audiotype_t;1387 1388 1379 audiotype_t gstCheckAudioPad(GstStructure* structure) 1389 1380 { … … 1430 1421 return atUnknown; 1431 1422 } 1423 1424 1425 subtype_t getSubtitleType(GstPad* pad, gchar *g_codec) 1426 { 1427 g_codec = NULL; 1428 subtype_t type = stUnknown; 1429 #if GST_VERSION_MAJOR < 1 1430 GstCaps* caps = gst_pad_get_negotiated_caps(pad); 1431 #else 1432 GstCaps* caps = gst_pad_get_current_caps(pad); 1433 #endif 1434 if (!caps && !g_codec) 1435 { 1436 caps = gst_pad_get_allowed_caps(pad); 1437 } 1438 1439 if (caps && !gst_caps_is_empty(caps)) 1440 { 1441 GstStructure* str = gst_caps_get_structure(caps, 0); 1442 if (str) 1443 { 1444 const gchar *g_type = gst_structure_get_name(str); 1445 // eDebug("getSubtitleType::subtitle probe caps type=%s", g_type ? g_type : "(null)"); 1446 if (g_type) 1447 { 1448 if ( !strcmp(g_type, "video/x-dvd-subpicture") ) 1449 type = stVOB; 1450 else if ( !strcmp(g_type, "text/x-pango-markup") ) 1451 type = stSRT; 1452 else if ( !strcmp(g_type, "text/plain") || !strcmp(g_type, "text/x-plain") || !strcmp(g_type, "text/x-raw") ) 1453 type = stPlainText; 1454 else if ( !strcmp(g_type, "subpicture/x-pgs") ) 1455 type = stPGS; 1456 else 1457 printf("getSubtitleType::unsupported subtitle caps %s (%s)\n", g_type, g_codec ? g_codec : "(null)"); 1458 // eDebug("getSubtitleType::unsupported subtitle caps %s (%s)", g_type, g_codec ? g_codec : "(null)"); 1459 } 1460 } 1461 } 1462 else if ( g_codec ) 1463 { 1464 // eDebug("getSubtitleType::subtitle probe codec tag=%s", g_codec); 1465 if ( !strcmp(g_codec, "VOB") ) 1466 type = stVOB; 1467 else if ( !strcmp(g_codec, "SubStation Alpha") || !strcmp(g_codec, "SSA") ) 1468 type = stSSA; 1469 else if ( !strcmp(g_codec, "ASS") ) 1470 type = stASS; 1471 else if ( !strcmp(g_codec, "SRT") ) 1472 type = stSRT; 1473 else if ( !strcmp(g_codec, "UTF-8 plain text") ) 1474 type = stPlainText; 1475 else 1476 printf("getSubtitleType::unsupported subtitle codec %s\n", g_codec); 1477 } 1478 else 1479 printf("getSubtitleType::unidentifiable subtitle stream!\n"); 1480 1481 return type; 1482 } 1483 1432 1484 #endif 1433 1485 … … 1508 1560 g_object_get(pipeline, "n-audio", &n_audio, NULL); 1509 1561 g_object_get(pipeline, "n-text", &n_text, NULL); 1510 1562 1511 1563 switch(type) 1512 1564 { … … 1542 1594 { 1543 1595 printf("Audio Codec: %s\n", g_codec); 1544 1545 tmpstr = ostrcat(g_codec, NULL, 0, 0); 1546 if(tmpstr != NULL) 1596 1597 tmpstr = ostrcat(oitoa(i), ": ", 1, 0); 1598 tmpstr = ostrcat(tmpstr, g_codec, 1, 0); 1599 if(g_codec != NULL && g_type != NULL) 1547 1600 tmpstr = ostrcat(tmpstr, " (", 1, 0); 1548 1601 tmpstr = ostrcat(tmpstr, (gchar*)g_type, 1, 0); 1549 if(g_codec != NULL )1602 if(g_codec != NULL && g_type != NULL) 1550 1603 tmpstr = ostrcat(tmpstr, ")", 1, 0); 1604 1605 printf("Tracklist tmpstr: %s\n", tmpstr); 1551 1606 1552 1607 TrackList[i * 2] = ostrcat(tmpstr, NULL, 0, 0); … … 1566 1621 printf("Audio Codec: %s\n", g_codec); 1567 1622 1568 tmpstr = ostrcat(g_codec, NULL, 0, 0); 1569 if(tmpstr != NULL) 1623 tmpstr = ostrcat(oitoa(i), ": ", 1, 0); 1624 tmpstr = ostrcat(tmpstr, g_codec, 1, 0); 1625 if(g_codec != NULL && g_type != NULL) 1570 1626 tmpstr = ostrcat(tmpstr, " (", 1, 0); 1571 1627 tmpstr = ostrcat(tmpstr, (gchar*)g_type, 1, 0); 1572 if(g_codec != NULL )1628 if(g_codec != NULL && g_type != NULL) 1573 1629 tmpstr = ostrcat(tmpstr, ")", 1, 0); 1574 1630 1631 printf("Tracklist tmpstr: %s\n", tmpstr); 1575 1632 TrackList[i * 2] = ostrcat(tmpstr, NULL, 0, 0); 1576 1633 … … 1585 1642 GstTagList *tags = NULL; 1586 1643 gchar *g_codec = NULL, *g_lang = NULL; 1587 // GstPad* pad = 0; 1588 1644 GstPad* pad = 0; 1645 char* tmpstr = NULL; 1646 1647 g_signal_emit_by_name (pipeline, "get-text-pad", i, &pad); 1648 printf("SubTitle Type: %d\n", getSubtitleType(pad, g_codec)); 1649 1650 #if GST_VERSION_MAJOR < 1 1651 GstCaps* caps = gst_pad_get_negotiated_caps(pad); 1652 #else 1653 GstCaps* caps = gst_pad_get_current_caps(pad); 1654 #endif 1655 if (!caps && !g_codec) 1656 { 1657 caps = gst_pad_get_allowed_caps(pad); 1658 } 1659 1660 GstStructure* str = gst_caps_get_structure(caps, 0); 1661 const gchar *g_type = gst_structure_get_name(str); 1662 1589 1663 g_signal_emit_by_name(pipeline, "get-text-tags", i, &tags); 1590 1664 … … 1598 1672 { 1599 1673 printf("SubTitle Codec: %s\n", g_codec); 1600 TrackList[i * 2] = ostrcat(g_codec, NULL, 0, 0); 1674 tmpstr = ostrcat(oitoa(i), ": ", 1, 0); 1675 tmpstr = ostrcat(tmpstr, g_codec, 1, 0); 1676 if(g_codec != NULL && g_type != NULL) 1677 tmpstr = ostrcat(tmpstr, " (", 1, 0); 1678 tmpstr = ostrcat(tmpstr, (gchar*)g_type, 1, 0); 1679 if(g_codec != NULL && g_type != NULL) 1680 tmpstr = ostrcat(tmpstr, ")", 1, 0); 1681 1682 printf("Tracklist tmpstr: %s\n", tmpstr); 1683 TrackList[i * 2] = ostrcat(tmpstr, NULL, 0, 0); 1601 1684 g_free(g_codec); g_codec = NULL; 1602 1685 } … … 1609 1692 gst_tag_list_free(tags); 1610 1693 } 1611 /* 1612 g_signal_emit_by_name(pipeline, "get-text-pad", i, &pad); 1613 if(pad) 1614 g_signal_connect(G_OBJECT(pad), "notify::caps", G_CALLBACK (gstTextpadHasCAPS), this); 1615 1616 printf("getSubtitleType: %d\n", getSubtitleType(pad, g_codec)); 1617 */ 1694 else 1695 { 1696 printf("SubTitle Codec: %s\n", g_codec); 1697 1698 tmpstr = ostrcat(oitoa(i), ": ", 1, 0); 1699 tmpstr = ostrcat(tmpstr, g_codec, 1, 0); 1700 if(g_codec != NULL && g_type != NULL) 1701 tmpstr = ostrcat(tmpstr, " (", 1, 0); 1702 tmpstr = ostrcat(tmpstr, (gchar*)g_type, 1, 0); 1703 if(g_codec != NULL && g_type != NULL) 1704 tmpstr = ostrcat(tmpstr, ")", 1, 0); 1705 1706 printf("Tracklist tmpstr: %s\n", tmpstr); 1707 TrackList[i * 2] = ostrcat(tmpstr, NULL, 0, 0); 1708 1709 g_free(tmpstr); tmpstr = NULL; 1710 g_free(g_codec); g_codec = NULL; 1711 } 1618 1712 } 1619 1713 break; -
titan/titan/struct.h
r30665 r30678 1902 1902 }; 1903 1903 1904 #ifdef EPLAYER4 1905 typedef enum { stUnknown, stPlainText, stSSA, stASS, stSRT, stVOB, stPGS } subtype_t; 1906 typedef enum {atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC, atWMA} audiotype_t; 1907 typedef struct _CustomData { 1908 gboolean is_live; 1909 GstElement *pipeline; 1910 GMainLoop *loop; 1911 } CustomData; 1904 1912 #endif 1913 1914 #endif
Note: See TracChangeset
for help on using the changeset viewer.