mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 23:42:43 +02:00
Merge remote-tracking branch 'tangocash/master'
Origin commit data
------------------
Branch: master
Commit: 2ea7de0658
Author: max_10 <max_10@gmx.de>
Date: 2017-10-28 (Sat, 28 Oct 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -226,8 +226,14 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian)
|
|||||||
if ((!dsp_dev) || (access(dsp_dev, W_OK))) {
|
if ((!dsp_dev) || (access(dsp_dev, W_OK))) {
|
||||||
if (dsp_dev)
|
if (dsp_dev)
|
||||||
lt_info("%s: DSP_DEVICE is set (%s) but cannot be opened,"
|
lt_info("%s: DSP_DEVICE is set (%s) but cannot be opened,"
|
||||||
" fall back to /dev/dsp1\n", __func__, dsp_dev);
|
" fall back to /dev/dsp\n", __func__, dsp_dev);
|
||||||
dsp_dev = "/dev/dsp1";
|
dsp_dev = "/dev/dsp";
|
||||||
|
}
|
||||||
|
if ((!mix_dev) || (access(mix_dev, W_OK))) {
|
||||||
|
if (mix_dev)
|
||||||
|
lt_info("%s: MIX_DEVICE is set (%s) but cannot be opened,"
|
||||||
|
" fall back to /dev/mixer\n", __func__, dsp_dev);
|
||||||
|
mix_dev = "/dev/mixer";
|
||||||
}
|
}
|
||||||
lt_info("%s: dsp_dev %s mix_dev %s\n", __func__, dsp_dev, mix_dev); /* NULL mix_dev is ok */
|
lt_info("%s: dsp_dev %s mix_dev %s\n", __func__, dsp_dev, mix_dev); /* NULL mix_dev is ok */
|
||||||
/* the tdoss dsp driver seems to work only on the second open(). really. */
|
/* the tdoss dsp driver seems to work only on the second open(). really. */
|
||||||
|
@@ -239,18 +239,23 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
|
|||||||
if ( gv_image )
|
if ( gv_image )
|
||||||
{
|
{
|
||||||
GstBuffer *buf_image;
|
GstBuffer *buf_image;
|
||||||
buf_image = gst_value_get_buffer (gv_image);
|
GstSample *sample;
|
||||||
|
sample = (GstSample *)g_value_get_boxed(gv_image);
|
||||||
|
buf_image = gst_sample_get_buffer(sample);
|
||||||
int fd = open("/tmp/.id3coverart", O_CREAT|O_WRONLY|O_TRUNC, 0644);
|
int fd = open("/tmp/.id3coverart", O_CREAT|O_WRONLY|O_TRUNC, 0644);
|
||||||
if(fd >= 0)
|
if (fd >= 0)
|
||||||
{
|
{
|
||||||
GstMapInfo Info;
|
guint8 *data;
|
||||||
gst_buffer_map(buf_image, &Info,(GstMapFlags)( GST_MAP_READ));
|
gsize size;
|
||||||
int ret = write(fd, Info.data, Info.size);
|
GstMapInfo map;
|
||||||
|
gst_buffer_map(buf_image, &map, GST_MAP_READ);
|
||||||
|
data = map.data;
|
||||||
|
size = map.size;
|
||||||
|
int ret = write(fd, data, size);
|
||||||
|
gst_buffer_unmap(buf_image, &map);
|
||||||
close(fd);
|
close(fd);
|
||||||
gst_buffer_unmap(buf_image, &Info);
|
lt_info_c("%s:%s - /tmp/.id3coverart %d bytes written ", FILENAME, __FUNCTION__, ret);
|
||||||
lt_info_c( "%s:%s - GST_MESSAGE_INFO: cPlayback::state /tmp/.id3coverart %d bytes written\n", FILENAME, __FUNCTION__, ret);
|
|
||||||
}
|
}
|
||||||
//FIXME: how shall playback handle this event???
|
|
||||||
}
|
}
|
||||||
gst_tag_list_free(tags);
|
gst_tag_list_free(tags);
|
||||||
lt_debug_c( "%s:%s - GST_MESSAGE_INFO: update info tags\n", FILENAME, __FUNCTION__); //FIXME: how shall playback handle this event???
|
lt_debug_c( "%s:%s - GST_MESSAGE_INFO: update info tags\n", FILENAME, __FUNCTION__); //FIXME: how shall playback handle this event???
|
||||||
@@ -751,10 +756,13 @@ bool cPlayback::GetPosition(int &position, int &duration)
|
|||||||
if (audioSink || videoSink)
|
if (audioSink || videoSink)
|
||||||
{
|
{
|
||||||
g_signal_emit_by_name(audioSink ? audioSink : videoSink, "get-decoder-time", &pts);
|
g_signal_emit_by_name(audioSink ? audioSink : videoSink, "get-decoder-time", &pts);
|
||||||
if (!GST_CLOCK_TIME_IS_VALID(pts)){
|
if (!GST_CLOCK_TIME_IS_VALID(pts))
|
||||||
|
{
|
||||||
lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__);
|
lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if(!gst_element_query_position(m_gst_playbin, fmt, &pts))
|
if(!gst_element_query_position(m_gst_playbin, fmt, &pts))
|
||||||
lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__);
|
lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
@@ -974,13 +982,18 @@ uint64_t cPlayback::GetReadCount()
|
|||||||
|
|
||||||
int cPlayback::GetAPid(void)
|
int cPlayback::GetAPid(void)
|
||||||
{
|
{
|
||||||
lt_info("%s\n", __func__);
|
gint current_audio = 0;
|
||||||
return mAudioStream;
|
g_object_get (m_gst_playbin, "current-audio", ¤t_audio, NULL);
|
||||||
|
lt_info("%s: %d audio\n", __FUNCTION__, current_audio);
|
||||||
|
return current_audio;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cPlayback::GetVPid(void)
|
int cPlayback::GetVPid(void)
|
||||||
{
|
{
|
||||||
return 0;
|
gint current_video = 0;
|
||||||
|
g_object_get (m_gst_playbin, "current-video", ¤t_video, NULL);
|
||||||
|
lt_info("%s: %d video\n", __FUNCTION__, current_video);
|
||||||
|
return current_video;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cPlayback::GetSubtitlePid(void)
|
int cPlayback::GetSubtitlePid(void)
|
||||||
|
@@ -758,7 +758,7 @@ bool Input::GetMetadata(std::vector<std::string> &keys, std::vector<std::string>
|
|||||||
for(unsigned int i = 0; i < avfc->nb_streams; i++) {
|
for(unsigned int i = 0; i < avfc->nb_streams; i++) {
|
||||||
if (avfc->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC) {
|
if (avfc->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC) {
|
||||||
AVPacket *pkt = &avfc->streams[i]->attached_pic;
|
AVPacket *pkt = &avfc->streams[i]->attached_pic;
|
||||||
FILE *cover_art = fopen("/tmp/cover.jpg", "wb");
|
FILE *cover_art = fopen("/tmp/.id3coverart", "wb");
|
||||||
if (cover_art) {
|
if (cover_art) {
|
||||||
fwrite(pkt->data, pkt->size, 1, cover_art);
|
fwrite(pkt->data, pkt->size, 1, cover_art);
|
||||||
fclose(cover_art);
|
fclose(cover_art);
|
||||||
|
Reference in New Issue
Block a user