[mythtv] Fwd: [mythtv-commits] mythtv branch master updated by jyavenard. v0.28-pre-1024-g9cba5e2

Craig Treleaven ctreleaven at cogeco.ca
Thu Mar 27 16:42:34 UTC 2014


At 1:18 PM +1100 3/27/14, Jean-Yves Avenard wrote:
>On 27 March 2014 12:25, Craig Treleaven <ctreleaven at cogeco.ca> wrote:
>
>>  Is it possible that the image isn't complete or is malformed so way? The
>>  logging indicates it is transferred in 1428 byte chunks.  Is it possible
>>  that the last chunk is being dropped or padded and therefore is malformed?
>
>no... this is multi-part mime. The size of the file being received is
>known in advance. We read until we have received all the data.
>
>Also, you are receiving a proper image.
>From your log:
>Received 960x720 png photo
>
>if it reads the actual dimension and the QImage object was created, it
>means the data is valid
>
>
>You can if you want to check write the image received to disk. and
>check the file yourself.
>
>Use the following patch:
>
>diff --git a/mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp
>b/mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp
>index 0a6c046..7d7c118 100644
>--- a/mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp
>+++ b/mythtv/libs/libmythtv/AirPlay/mythairplayserver.cpp
>@@ -843,6 +843,15 @@ void 
>MythAirplayServer::HandleResponse(APHTTPRequest *req,
>                  .arg(image.width()).arg(image.height()).
>                  arg(png ? "jpeg" : "png"));
>
>+            if (!image.save("/tmp/airplayimage", png ? "png" : "jpeg"))
>+            {
>+                LOG(VB_GENERAL, LOG_ERR, LOC + "Error writing image 
>to disk");
>+            }
>+            QFile file("/tmp/airplayimagebin");
>+            file.open(QIODevice::WriteOnly);
>+            file.write(req->GetBody());
>+            file.close();
>+
>              if (m_connections[session].notificationid < 0)
>              {
>                  m_connections[session].notificationid =
>
>This will write two files:
>/tmp/airplayimagebin which is the file exactly as it was received
>and /tmp/airplayimage which is the QImage saved using QImage::save().
>A QImage is a bitmap internally, so that means the file will be
>re-encoded in the required format, and as such different than the
>original
>
>but you can you the finder to check what the file looks like
>
>If you are seeing a red circle where the image is supposed to be
>displayed, there will be an error somewhere, or the theme is wrong....
>check the log.

Built a new version with the patch and tested videos (OK), music 
(fine but no album art displayed in Notification) and photos (slash 
zero displayed).  However, I can't make any sense of the files the 
patch produced!  ...

CT-MBP11:mythtv-core.27_rev06_jya_patch craigtreleaven$ ls -al /tmp/air*
-rw-r--r--  1 craigtreleaven  wheel  31805 27 Mar 11:55 /tmp/airplayimage
-rw-r--r--  1 craigtreleaven  wheel  99120 27 Mar 11:55 /tmp/airplayimagebin
CT-MBP11:mythtv-core.27_rev06_jya_patch craigtreleaven$ which mediainfo
/opt/local/bin/mediainfo
CT-MBP11:mythtv-core.27_rev06_jya_patch craigtreleaven$ mediainfo --version
MediaInfo Command line,
MediaInfoLib - v0.7.64
CT-MBP11:mythtv-core.27_rev06_jya_patch craigtreleaven$ mediainfo 
/tmp/airplayimage
General
Complete name                            : /tmp/airplayimage
Format                                   : JPEG
File size                                : 31.1 KiB

Image
Format                                   : JPEG
Width                                    : 510 pixels
Height                                   : 720 pixels
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Compression mode                         : Lossy
Stream size                              : 31.1 KiB (100%)


CT-MBP11:mythtv-core.27_rev06_jya_patch craigtreleaven$ mediainfo 
/tmp/airplayimagebin
General
Complete name                            : /tmp/airplayimagebin
Format                                   : JPEG
File size                                : 96.8 KiB

Image
Format                                   : JPEG
Width                                    : 510 pixels
Height                                   : 720 pixels
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Compression mode                         : Lossy
Stream size                              : 96.8 KiB (100%)

The logs say that a png file was transferred.  The errors I saw were 
in libpng.  How can it be that these files are in jpeg format?  I can 
view these without issue in Finder's Quick Look and GraphicConverter 
(after adding the .jpeg extension, at least for the Finder).  And the 
Qt4-based QIviewer opens and displays them without error.

BTW, airplayimage is just a more-heavily compressed version of 
airplayimagebin; they are the same picture.

Does this make sense to you?

Craig


More information about the mythtv-dev mailing list