[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/kmplayer/src
From:       Koos Vriezen <koos.vriezen () gmail ! com>
Date:       2006-09-04 19:34:52
Message-ID: 1157398492.760912.25622.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 580899 by vriezen:

Darn, with NVidia latest(*) I can't use Xv anymore for v4l devices. Worse, 
the mplayer frequency setting is not compatable with the Xv one. So make 
it default to MHz, and store it in kHz.
(*)I could downgrade, but w/ xorg-7.1 video and composite is my personal 
   favorite disruptive technology :-)


 M  +1 -0      kmplayersource.h  
 M  +5 -5      kmplayertvsource.cpp  
 M  +1 -1      kmplayertvsource.h  
 M  +1 -1      xvplayer.cpp  


--- trunk/extragear/multimedia/kmplayer/src/kmplayersource.h #580898:580899
@@ -68,6 +68,7 @@
     KDE_NO_EXPORT const QString & audioDevice () const { return m_audiodevice; }
     KDE_NO_EXPORT const QString & videoDevice () const { return m_videodevice; }
     KDE_NO_EXPORT const QString & videoNorm () const { return m_videonorm; }
+    /* frequency() if set, returns frequency in kHz */
     KDE_NO_EXPORT int frequency () const { return m_frequency; }
     KDE_NO_EXPORT int xvPort () const { return m_xvport; }
     KDE_NO_EXPORT int xvEncoding () const { return m_xvencoding; }
--- trunk/extragear/multimedia/kmplayer/src/kmplayertvsource.cpp #580898:580899
@@ -97,7 +97,7 @@
             QFontMetrics metrics (table->font ());
             QHeader *header = table->horizontalHeader();
             header->setLabel (0, i18n ("Channel"));
-            header->setLabel (1, i18n ("Frequency"));
+            header->setLabel (1, i18n ("Frequency (MHz)"));
             int index = 0;
             int first_column_width = QFontMetrics (header->font ()).boundingRect \
                (header->label (0)).width () + 20;
             for (KMPlayer::NodePtr c=input->firstChild();c;c=c->nextSibling()) {
@@ -189,9 +189,9 @@
 
 //-----------------------------------------------------------------------------
 
-KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d, const QString & n, \
int freq) : TVNode (d, QString ("tv://"), "channel", id_node_tv_channel, n) { \
+KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d, const QString & n, \
double freq) : TVNode (d, QString ("tv://"), "channel", id_node_tv_channel, n) {  \
                setAttribute ("name", n);
-    setAttribute ("frequency", QString::number (freq));
+    setAttribute ("frequency", QString::number (freq, 'f', 2));
 }
 
 KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d) : TVNode (d, \
QString ("tv://"), "channel", id_node_tv_channel) { @@ -302,7 +302,7 @@
             if (table) {
                 input->clearChildren ();
                 for (int j = 0; j<table->numRows() && table->item (j, 1); ++j) {
-                    input->appendChild (new TVChannel (m_doc, table->item (j, \
0)->text (), table->item (j, 1)->text ().toInt ())); +                    \
input->appendChild (new TVChannel (m_doc, table->item (j, 0)->text (), table->item \
(j, 1)->text ().toDouble ()));  }
             }
             QComboBox * norms = static_cast <QComboBox *> (widget->child \
("PageTVNorm", "QComboBox")); @@ -455,7 +455,7 @@
     command.sprintf ("device=%s:input=%s", tvdevice->src.ascii (), \
input->getAttribute ("id").ascii ());  if (channel) {
         QString freq = channel->getAttribute ("frequency");
-        m_frequency = freq.toInt ();
+        m_frequency = (int)(1000 * freq.toDouble ());
         command += QString (":freq=%1").arg (freq);
     } else
         m_frequency = 0;
--- trunk/extragear/multimedia/kmplayer/src/kmplayertvsource.h #580898:580899
@@ -92,7 +92,7 @@
  */
 class KMPLAYER_NO_EXPORT TVChannel : public TVNode {
 public:
-    TVChannel (KMPlayer::NodePtr & d, const QString & n, int f);
+    TVChannel (KMPlayer::NodePtr & d, const QString & n, double f);
     TVChannel (KMPlayer::NodePtr & d);
     KDE_NO_CDTOR_EXPORT ~TVChannel () {}
     void closed ();
--- trunk/extragear/multimedia/kmplayer/src/xvplayer.cpp #580898:580899
@@ -383,7 +383,7 @@
             XFree (attributes);
         }
         if (xv_frequency > 0)
-            XvSetPortAttribute (display, xvport, xv_freq_atom, int \
(1.0*xv_frequency/6.25)); +            XvSetPortAttribute (display, xvport, \
xv_freq_atom, int (1.0*xv_frequency/62.5));  if (xv_encoding >= 0)
             XvSetPortAttribute (display, xvport, xv_enc_atom, xv_encoding);
         if (XvGetPortAttribute (display, xvport, xv_mute_atom, &cur_val) ==


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic