mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
libgeneric: some manual code nicenings
Origin commit data
------------------
Branch: master
Commit: 0d8aaf19ab
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-11-07 (Sun, 07 Nov 2021)
Origin message was:
------------------
- libgeneric: some manual code nicenings
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -160,8 +160,7 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int le)
|
||||
hal_debug("%s ch %d srate %d bits %d le %d adevice %p\n", __func__, ch, srate, bits, le, adevice);;
|
||||
int driver;
|
||||
int byte_format = le ? AO_FMT_LITTLE : AO_FMT_BIG;
|
||||
if (sformat.bits != bits || sformat.channels != ch || sformat.rate != srate ||
|
||||
sformat.byte_format != byte_format || adevice == NULL)
|
||||
if (sformat.bits != bits || sformat.channels != ch || sformat.rate != srate || sformat.byte_format != byte_format || adevice == NULL)
|
||||
{
|
||||
driver = ao_default_driver_id();
|
||||
sformat.bits = bits;
|
||||
@@ -173,10 +172,8 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int le)
|
||||
ao_close(adevice);
|
||||
adevice = ao_open_live(driver, &sformat, NULL);
|
||||
ao_info *ai = ao_driver_info(driver);
|
||||
hal_info("%s: changed params ch %d srate %d bits %d le %d adevice %p\n",
|
||||
__func__, ch, srate, bits, le, adevice);;
|
||||
hal_info("libao driver: %d name '%s' short '%s' author '%s'\n",
|
||||
driver, ai->name, ai->short_name, ai->author);
|
||||
hal_info("%s: changed params ch %d srate %d bits %d le %d adevice %p\n", __func__, ch, srate, bits, le, adevice);;
|
||||
hal_info("libao driver: %d name '%s' short '%s' author '%s'\n", driver, ai->name, ai->short_name, ai->author);
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
@@ -280,13 +277,11 @@ void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &m
|
||||
mode = 7; // "L/C/R/SL/SR"
|
||||
break;
|
||||
default:
|
||||
hal_info("%s: unknown ch_layout 0x%" PRIx64 "\n",
|
||||
__func__, c->channel_layout);
|
||||
hal_info("%s: unknown ch_layout 0x%" PRIx64 "\n", __func__, c->channel_layout);
|
||||
}
|
||||
}
|
||||
}
|
||||
hal_debug("%s t: %d l: %d f: %d b: %d m: %d codec_id: %x\n",
|
||||
__func__, type, layer, freq, bitrate, mode, c ? c->codec_id : -1);
|
||||
hal_debug("%s t: %d l: %d f: %d b: %d m: %d codec_id: %x\n", __func__, type, layer, freq, bitrate, mode, c ? c->codec_id : -1);
|
||||
};
|
||||
|
||||
void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/)
|
||||
@@ -453,8 +448,7 @@ void cAudio::run()
|
||||
o_ch = p->channels; /* 2 */
|
||||
o_sr = p->sample_rate; /* 48000 */
|
||||
o_layout = p->channel_layout; /* AV_CH_LAYOUT_STEREO */
|
||||
if (sformat.channels != o_ch || sformat.rate != o_sr ||
|
||||
sformat.byte_format != AO_FMT_NATIVE || sformat.bits != 16 || adevice == NULL)
|
||||
if (sformat.channels != o_ch || sformat.rate != o_sr || sformat.byte_format != AO_FMT_NATIVE || sformat.bits != 16 || adevice == NULL)
|
||||
{
|
||||
driver = ao_default_driver_id();
|
||||
sformat.bits = 16;
|
||||
@@ -466,11 +460,9 @@ void cAudio::run()
|
||||
ao_close(adevice);
|
||||
adevice = ao_open_live(driver, &sformat, NULL);
|
||||
ai = ao_driver_info(driver);
|
||||
hal_info("%s: changed params ch %d srate %d bits %d adevice %p\n",
|
||||
__func__, o_ch, o_sr, 16, adevice);
|
||||
hal_info("%s: changed params ch %d srate %d bits %d adevice %p\n", __func__, o_ch, o_sr, 16, adevice);
|
||||
if (ai)
|
||||
hal_info("libao driver: %d name '%s' short '%s' author '%s'\n",
|
||||
driver, ai->name, ai->short_name, ai->author);
|
||||
hal_info("libao driver: %d name '%s' short '%s' author '%s'\n", driver, ai->name, ai->short_name, ai->author);
|
||||
}
|
||||
#if 0
|
||||
hal_info(" driver options:");
|
||||
@@ -479,8 +471,7 @@ void cAudio::run()
|
||||
fprintf(stderr, "\n");
|
||||
#endif
|
||||
av_get_sample_fmt_string(tmp, sizeof(tmp), c->sample_fmt);
|
||||
hal_info("decoding %s, sample_fmt %d (%s) sample_rate %d channels %d\n",
|
||||
avcodec_get_name(p->codec_id), c->sample_fmt, tmp, p->sample_rate, p->channels);
|
||||
hal_info("decoding %s, sample_fmt %d (%s) sample_rate %d channels %d\n", avcodec_get_name(p->codec_id), c->sample_fmt, tmp, p->sample_rate, p->channels);
|
||||
swr = swr_alloc_set_opts(swr,
|
||||
o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */
|
||||
p->channel_layout, c->sample_fmt, p->sample_rate, /* input */
|
||||
@@ -526,8 +517,7 @@ void cAudio::run()
|
||||
{
|
||||
hal_info("obuf_sz: %d old: %d\n", obuf_sz, obuf_sz_max);
|
||||
av_free(obuf);
|
||||
if (av_samples_alloc(&obuf, &out_linesize, o_ch,
|
||||
frame->nb_samples, AV_SAMPLE_FMT_S16, 1) < 0)
|
||||
if (av_samples_alloc(&obuf, &out_linesize, o_ch, frame->nb_samples, AV_SAMPLE_FMT_S16, 1) < 0)
|
||||
{
|
||||
hal_info("av_samples_alloc failed\n");
|
||||
av_packet_unref(&avpkt);
|
||||
@@ -535,8 +525,7 @@ void cAudio::run()
|
||||
}
|
||||
obuf_sz_max = obuf_sz;
|
||||
}
|
||||
obuf_sz = swr_convert(swr, &obuf, obuf_sz,
|
||||
(const uint8_t **)frame->extended_data, frame->nb_samples);
|
||||
obuf_sz = swr_convert(swr, &obuf, obuf_sz, (const uint8_t **)frame->extended_data, frame->nb_samples);
|
||||
#if (LIBAVUTIL_VERSION_MAJOR < 54)
|
||||
curr_pts = av_frame_get_best_effort_timestamp(frame);
|
||||
#else
|
||||
|
@@ -42,6 +42,7 @@ typedef enum
|
||||
class cAudio : public OpenThreads::Thread
|
||||
{
|
||||
friend class cPlayback;
|
||||
|
||||
private:
|
||||
int fd;
|
||||
bool Muted;
|
||||
@@ -69,51 +70,27 @@ class cAudio : public OpenThreads::Thread
|
||||
/* construct & destruct */
|
||||
cAudio(void *, void *, void *);
|
||||
~cAudio(void);
|
||||
int64_t getPts()
|
||||
{
|
||||
return curr_pts;
|
||||
}
|
||||
int64_t getPts() { return curr_pts; }
|
||||
|
||||
void *GetHandle()
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
void *GetHandle() { return NULL; };
|
||||
|
||||
void setAVInput(int /*val*/)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void setAVInput(int /*val*/) { return; };
|
||||
|
||||
/* shut up */
|
||||
int mute(bool remember = true)
|
||||
{
|
||||
return do_mute(true, remember);
|
||||
};
|
||||
int unmute(bool remember = true)
|
||||
{
|
||||
return do_mute(false, remember);
|
||||
};
|
||||
int mute(bool remember = true) { return do_mute(true, remember); };
|
||||
int unmute(bool remember = true) { return do_mute(false, remember); };
|
||||
|
||||
/* volume, min = 0, max = 255 */
|
||||
int setVolume(unsigned int left, unsigned int right);
|
||||
int getVolume(void)
|
||||
{
|
||||
return volume;
|
||||
}
|
||||
bool getMuteStatus(void)
|
||||
{
|
||||
return Muted;
|
||||
};
|
||||
int getVolume(void) { return volume; }
|
||||
bool getMuteStatus(void) { return Muted; };
|
||||
|
||||
/* start and stop audio */
|
||||
int Start(void);
|
||||
int Stop(void);
|
||||
bool Pause(bool Pcm = true);
|
||||
void SetStreamType(int bypass);
|
||||
int GetStreamType(void)
|
||||
{
|
||||
return StreamType;
|
||||
}
|
||||
int GetStreamType(void) { return StreamType; }
|
||||
void SetSyncMode(AVSYNC_TYPE Mode);
|
||||
|
||||
/* select channels */
|
||||
|
@@ -353,8 +353,7 @@ void GLFbPC::render()
|
||||
// *mX = *mY * mOA.num / mOA.den;
|
||||
clutter_actor_set_size(stage, *mX, *mY);
|
||||
}
|
||||
hal_info("%s: reinit mX:%d mY:%d xoff:%d yoff:%d fs %d\n",
|
||||
__func__, *mX, *mY, xoff, yoff, mFullscreen);
|
||||
hal_info("%s: reinit mX:%d mY:%d xoff:%d yoff:%d fs %d\n", __func__, *mX, *mY, xoff, yoff, mFullscreen);
|
||||
}
|
||||
mReInitLock.unlock();
|
||||
|
||||
|
@@ -113,8 +113,8 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
|
||||
hal_info("%s %s: %m\n", __FUNCTION__, devname[devnum]);
|
||||
return false;
|
||||
}
|
||||
hal_debug("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__,
|
||||
num, DMX_T[pes_type], pes_type, uBufferSize, fd);
|
||||
hal_debug("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n",
|
||||
__func__, num, DMX_T[pes_type], pes_type, uBufferSize, fd);
|
||||
|
||||
if (dmx_type == DMX_VIDEO_CHANNEL)
|
||||
uBufferSize = 0x100000; /* 1MB */
|
||||
@@ -359,8 +359,8 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte
|
||||
if (timeout == 0 && negmask == NULL)
|
||||
s_flt.timeout = to;
|
||||
|
||||
hal_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n", __func__, num,
|
||||
pid, fd, DMX_T[dmx_type], len, s_flt.timeout, s_flt.flags, s_flt.filter.filter[0]);
|
||||
hal_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n",
|
||||
__func__, num, pid, fd, DMX_T[dmx_type], len, s_flt.timeout, s_flt.flags, s_flt.filter.filter[0]);
|
||||
|
||||
if (debuglevel == 2)
|
||||
{
|
||||
|
@@ -394,8 +394,7 @@ void GLFbPC::render()
|
||||
}
|
||||
else
|
||||
*mX = *mY * mOA.num / mOA.den;
|
||||
hal_info("%s: reinit mX:%d mY:%d xoff:%d yoff:%d fs %d\n",
|
||||
__func__, *mX, *mY, xoff, yoff, mFullscreen);
|
||||
hal_info("%s: reinit mX:%d mY:%d xoff:%d yoff:%d fs %d\n", __func__, *mX, *mY, xoff, yoff, mFullscreen);
|
||||
glViewport(xoff, yoff, *mX, *mY);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
@@ -81,18 +81,12 @@ class cPlayback
|
||||
int GetSubtitlePid(void);
|
||||
bool SetPosition(int position, bool absolute = false);
|
||||
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language)
|
||||
{
|
||||
FindAllPids((int *) apids, (unsigned int *) ac3flags, (unsigned int *) numpida, language);
|
||||
};
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language) { FindAllPids((int *) apids, (unsigned int *) ac3flags, (unsigned int *) numpida, language); };
|
||||
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage, int *mags, int *pages);
|
||||
void RequestAbort(void);
|
||||
void FindAllSubs(int *pids, unsigned int *supported, unsigned int *numpida, std::string *language);
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language)
|
||||
{
|
||||
FindAllSubs((int *) pids, (unsigned int *) supported, (unsigned int *) numpida, language);
|
||||
};
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int *) pids, (unsigned int *) supported, (unsigned int *) numpida, language); };
|
||||
bool SelectSubtitles(int pid, std::string charset = "");
|
||||
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int ¤t);
|
||||
void SetTitle(int title);
|
||||
|
@@ -188,7 +188,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
|
||||
{
|
||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
{
|
||||
GstIterator *children;
|
||||
@@ -212,10 +213,12 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
{
|
||||
if (audioSink)
|
||||
@@ -232,7 +235,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -279,8 +283,7 @@ cPlayback::cPlayback(int num)
|
||||
nano_str = "";
|
||||
|
||||
hal_info("%s:%s - This program is linked against GStreamer %d.%d.%d %s\n",
|
||||
FILENAME, __FUNCTION__,
|
||||
major, minor, micro, nano_str);
|
||||
FILENAME, __FUNCTION__, major, minor, micro, nano_str);
|
||||
|
||||
mAudioStream = 0;
|
||||
mSpeed = 0;
|
||||
|
@@ -357,7 +357,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
|
||||
{
|
||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
{
|
||||
GstIterator *children;
|
||||
@@ -396,10 +397,12 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
{
|
||||
if (audioSink)
|
||||
@@ -416,7 +419,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data)
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
{
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -453,8 +457,7 @@ cPlayback::cPlayback(int num)
|
||||
nano_str = "";
|
||||
|
||||
hal_info("%s:%s - This program is linked against GStreamer %d.%d.%d %s\n",
|
||||
FILENAME, __FUNCTION__,
|
||||
major, minor, micro, nano_str);
|
||||
FILENAME, __FUNCTION__, major, minor, micro, nano_str);
|
||||
|
||||
mAudioStream = 0;
|
||||
mSpeed = 0;
|
||||
|
@@ -19,6 +19,7 @@ class cPlayback
|
||||
int mAudioStream;
|
||||
int mSubtitleStream;
|
||||
int mTeletextStream;
|
||||
|
||||
public:
|
||||
cPlayback(int);
|
||||
bool Open(playmode_t PlayMode);
|
||||
@@ -28,15 +29,9 @@ class cPlayback
|
||||
bool SetAPid(int pid, bool ac3);
|
||||
bool SetSubtitlePid(int pid);
|
||||
bool SetTeletextPid(int pid);
|
||||
int GetAPid(void)
|
||||
{
|
||||
return mAudioStream;
|
||||
}
|
||||
int GetAPid(void) { return mAudioStream; }
|
||||
int GetVPid(void);
|
||||
int GetSubtitlePid(void)
|
||||
{
|
||||
return mSubtitleStream;
|
||||
}
|
||||
int GetSubtitlePid(void) { return mSubtitleStream; }
|
||||
int GetTeletextPid(void);
|
||||
void SuspendSubtitle(bool);
|
||||
int GetFirstTeletextPid(void);
|
||||
@@ -46,23 +41,14 @@ class cPlayback
|
||||
void GetPts(uint64_t &pts);
|
||||
bool SetPosition(int position, bool absolute = false);
|
||||
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language)
|
||||
{
|
||||
FindAllPids((int *) apids, (unsigned int *) ac3flags, (unsigned int *) numpida, language);
|
||||
};
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language) { FindAllPids((int *) apids, (unsigned int *) ac3flags, (unsigned int *) numpida, language); };
|
||||
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage, int *mags, int *pages);
|
||||
void RequestAbort(void);
|
||||
bool IsPlaying(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool IsPlaying(void) { return false; }
|
||||
uint64_t GetReadCount(void);
|
||||
void FindAllSubs(int *pids, unsigned int *supported, unsigned int *numpida, std::string *language);
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language)
|
||||
{
|
||||
FindAllSubs((int *) pids, (unsigned int *) supported, (unsigned int *) numpida, language);
|
||||
};
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int *) pids, (unsigned int *) supported, (unsigned int *) numpida, language); };
|
||||
bool SelectSubtitles(int pid, std::string charset = "");
|
||||
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int ¤t);
|
||||
void SetTitle(int title);
|
||||
@@ -70,10 +56,7 @@ class cPlayback
|
||||
void GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values);
|
||||
//
|
||||
~cPlayback();
|
||||
AVFormatContext *GetAVFormatContext()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
AVFormatContext *GetAVFormatContext() { return NULL; }
|
||||
void ReleaseAVFormatContext() {}
|
||||
};
|
||||
|
||||
|
@@ -650,14 +650,11 @@ void cVideo::run(void)
|
||||
SWFramebuffer *f = &buffers[buf_in];
|
||||
if (f->size() < need)
|
||||
f->resize(need);
|
||||
av_image_fill_arrays(rgbframe->data, rgbframe->linesize, &(*f)[0], VDEC_PIXFMT,
|
||||
c->width, c->height, 1);
|
||||
sws_scale(convert, frame->data, frame->linesize, 0, c->height,
|
||||
rgbframe->data, rgbframe->linesize);
|
||||
av_image_fill_arrays(rgbframe->data, rgbframe->linesize, &(*f)[0], VDEC_PIXFMT, c->width, c->height, 1);
|
||||
sws_scale(convert, frame->data, frame->linesize, 0, c->height, rgbframe->data, rgbframe->linesize);
|
||||
if (dec_w != c->width || dec_h != c->height)
|
||||
{
|
||||
hal_info("%s: pic changed %dx%d -> %dx%d\n", __func__,
|
||||
dec_w, dec_h, c->width, c->height);
|
||||
hal_info("%s: pic changed %dx%d -> %dx%d\n", __func__, dec_w, dec_h, c->width, c->height);
|
||||
dec_w = c->width;
|
||||
dec_h = c->height;
|
||||
w_h_changed = true;
|
||||
@@ -697,13 +694,14 @@ void cVideo::run(void)
|
||||
dec_r = c->time_base.den / (c->time_base.num * c->ticks_per_frame);
|
||||
buf_m.unlock();
|
||||
}
|
||||
hal_debug("%s: time_base: %d/%d, ticks: %d rate: %d pts 0x%" PRIx64 "\n", __func__,
|
||||
c->time_base.num, c->time_base.den, c->ticks_per_frame, dec_r,
|
||||
hal_debug("%s: time_base: %d/%d, ticks: %d rate: %d pts 0x%" PRIx64 "\n",
|
||||
__func__, c->time_base.num, c->time_base.den, c->ticks_per_frame, dec_r,
|
||||
#if (LIBAVUTIL_VERSION_MAJOR < 54)
|
||||
av_frame_get_best_effort_timestamp(frame));
|
||||
av_frame_get_best_effort_timestamp(frame)
|
||||
#else
|
||||
frame->best_effort_timestamp);
|
||||
frame->best_effort_timestamp
|
||||
#endif
|
||||
);
|
||||
}
|
||||
else
|
||||
hal_debug("%s: got_frame: %d stillpicture: %d\n", __func__, got_frame, stillpicture);
|
||||
|
@@ -149,44 +149,21 @@ class cVideo : public OpenThreads::Thread
|
||||
{
|
||||
friend class GLFbPC;
|
||||
friend class cDemux;
|
||||
|
||||
private:
|
||||
/* called from GL thread */
|
||||
class SWFramebuffer : public std::vector<unsigned char>
|
||||
{
|
||||
public:
|
||||
SWFramebuffer() : mWidth(0), mHeight(0) {}
|
||||
void width(int w)
|
||||
{
|
||||
mWidth = w;
|
||||
}
|
||||
void height(int h)
|
||||
{
|
||||
mHeight = h;
|
||||
}
|
||||
void pts(uint64_t p)
|
||||
{
|
||||
mPts = p;
|
||||
}
|
||||
void AR(AVRational a)
|
||||
{
|
||||
mAR = a;
|
||||
}
|
||||
int width() const
|
||||
{
|
||||
return mWidth;
|
||||
}
|
||||
int height() const
|
||||
{
|
||||
return mHeight;
|
||||
}
|
||||
int64_t pts() const
|
||||
{
|
||||
return mPts;
|
||||
}
|
||||
AVRational AR() const
|
||||
{
|
||||
return mAR;
|
||||
}
|
||||
void width(int w) { mWidth = w; }
|
||||
void height(int h) { mHeight = h; }
|
||||
void pts(uint64_t p) { mPts = p; }
|
||||
void AR(AVRational a) { mAR = a; }
|
||||
int width() const { return mWidth; }
|
||||
int height() const { return mHeight; }
|
||||
int64_t pts() const { return mPts; }
|
||||
AVRational AR() const { return mAR; }
|
||||
private:
|
||||
int mWidth;
|
||||
int mHeight;
|
||||
@@ -195,23 +172,15 @@ class cVideo : public OpenThreads::Thread
|
||||
};
|
||||
int buf_in, buf_out, buf_num;
|
||||
int64_t GetPTS(void);
|
||||
|
||||
public:
|
||||
/* constructor & destructor */
|
||||
cVideo(int mode, void *, void *, unsigned int unit = 0);
|
||||
~cVideo(void);
|
||||
|
||||
void *GetTVEnc()
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
void *GetTVEncSD()
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
void setAVInput(int /*val*/)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void *GetTVEnc() { return NULL; };
|
||||
void *GetTVEncSD() { return NULL; };
|
||||
void setAVInput(int /*val*/) { return; };
|
||||
|
||||
/* aspect ratio */
|
||||
int getAspectRatio(void);
|
||||
@@ -241,66 +210,28 @@ class cVideo : public OpenThreads::Thread
|
||||
bool ShowPicture(const char *fname);
|
||||
|
||||
void SetSyncMode(AVSYNC_TYPE mode);
|
||||
bool SetCECMode(VIDEO_HDMI_CEC_MODE)
|
||||
{
|
||||
return true;
|
||||
};
|
||||
void SetCECAutoView(bool)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void SetCECAutoStandby(bool)
|
||||
{
|
||||
return;
|
||||
};
|
||||
int GetAudioDestination()
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
void SetAudioDestination(int /*audio_dest*/)
|
||||
{
|
||||
return;
|
||||
};
|
||||
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };
|
||||
void SetCECAutoView(bool) { return; };
|
||||
void SetCECAutoStandby(bool) { return; };
|
||||
int GetAudioDestination() { return 0; };
|
||||
void SetAudioDestination(int /*audio_dest*/) { return; };
|
||||
void StopPicture();
|
||||
void Standby(unsigned int bOn);
|
||||
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719);
|
||||
void SetControl(int, int)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void SetControl(int, int) { return; };
|
||||
void setContrast(int val);
|
||||
void SetVideoMode(analog_mode_t mode);
|
||||
void SetDBDR(int)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void SetAudioHandle(void *)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void SetAutoModes(int [VIDEO_STD_MAX])
|
||||
{
|
||||
return;
|
||||
};
|
||||
int OpenVBI(int)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
int CloseVBI(void)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
int StartVBI(unsigned short)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
int StopVBI(void)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
void SetDBDR(int) { return; };
|
||||
void SetAudioHandle(void *) { return; };
|
||||
void SetAutoModes(int [VIDEO_STD_MAX]) { return; };
|
||||
int OpenVBI(int) { return 0; };
|
||||
int CloseVBI(void) { return 0; };
|
||||
int StartVBI(unsigned short) { return 0; };
|
||||
int StopVBI(void) { return 0; };
|
||||
void SetDemux(cDemux *dmx);
|
||||
bool GetScreenImage(unsigned char *&data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false);
|
||||
SWFramebuffer *getDecBuf(void);
|
||||
|
||||
private:
|
||||
void run();
|
||||
SWFramebuffer buffers[VDEC_MAXBUFS];
|
||||
|
Reference in New Issue
Block a user