Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Preview images - skip commercial breaks.

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


mccoyn at gmail

Mar 19, 2005, 5:39 AM

Post #1 of 5 (915 views)
Permalink
Preview images - skip commercial breaks.

Sometimes my preview images show a commercial and are therefore not
very useful. I decided to code a patch to take advantage of the
commercial flags to avoid this. I've attached my work so far. Here
are some questions that came up.

1. Is it a problem to have images changing?

The images make a nice quick reference for the user about which
episode it is. The patch will cause the image to change when commflag
is run. I've thought about running the code only if the preview falls
in a commercial break. That would give less consistent selection
(some exact, some based on commercials), but would leave images
unchanged by commercial skipping unless they were in a commercial.

Another possibility is to make this behavior a configurable option. I
don't think that is necessary though.

2. Where should I change the code to recreate the image?

Currently, I delete the image file and the next time a preview image
is needed it reruns the code, which compensates for commercials. I'd
like to make the update automatic. One idea is to delete the file
when NuppelVideoPlayer::FlagCommercials is complete. Another is to
check if the recording is commercial flagged in
PlaybackBox::getPixmap. This second choice will require checking the
times of the image and the commercial flags somehow.

3. How do I get MythWeb to update the images?

I deleted the image file and regenerated it by browsing it in the
frontend. When I opened the web page it still had the old image.
Rebooting the backend and refreshing the page didn't help. I don't
know anything about Apache or Php so I'm completely lost on this one.

4. Should I use NuppelVideoPlayer::commBreakMap instead of a local variable?

This could be more efficient, but I'm worried about breaking the stuff
that uses this variable.
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mccoyn at gmail

Mar 19, 2005, 8:43 AM

Post #2 of 5 (889 views)
Permalink
Re: Preview images - skip commercial breaks. [In reply to]

Apparently the file wasn't attached to my first message for some
reason. I've attached my current changes to this message. There are
a couple changes.

It now uses the absoute offset as long as its not marked as a
commercial. This should prevent images from changing, unless they are
already a commercial. I also changed it to use
NuppelVideoPlayer::commBreakMap instead of a local variable.


On Sat, 19 Mar 2005 08:39:40 -0500, Nicholas McCoy <mccoyn [at] gmail> wrote:
> Sometimes my preview images show a commercial and are therefore not
> very useful. I decided to code a patch to take advantage of the
> commercial flags to avoid this. I've attached my work so far. Here
> are some questions that came up.
>
> 1. Is it a problem to have images changing?
>
> The images make a nice quick reference for the user about which
> episode it is. The patch will cause the image to change when commflag
> is run. I've thought about running the code only if the preview falls
> in a commercial break. That would give less consistent selection
> (some exact, some based on commercials), but would leave images
> unchanged by commercial skipping unless they were in a commercial.
>
> Another possibility is to make this behavior a configurable option. I
> don't think that is necessary though.
>
> 2. Where should I change the code to recreate the image?
>
> Currently, I delete the image file and the next time a preview image
> is needed it reruns the code, which compensates for commercials. I'd
> like to make the update automatic. One idea is to delete the file
> when NuppelVideoPlayer::FlagCommercials is complete. Another is to
> check if the recording is commercial flagged in
> PlaybackBox::getPixmap. This second choice will require checking the
> times of the image and the commercial flags somehow.
>
> 3. How do I get MythWeb to update the images?
>
> I deleted the image file and regenerated it by browsing it in the
> frontend. When I opened the web page it still had the old image.
> Rebooting the backend and refreshing the page didn't help. I don't
> know anything about Apache or Php so I'm completely lost on this one.
>
> 4. Should I use NuppelVideoPlayer::commBreakMap instead of a local variable?
>
> This could be more efficient, but I'm worried about breaking the stuff
> that uses this variable.
>
Attachments: preview-not-commercial-2.patch (4.02 KB)


risto at elkhornbanff

Mar 21, 2005, 8:40 AM

Post #3 of 5 (872 views)
Permalink
re: Preview images - skip commercial breaks. [In reply to]

Hi,

I coded this this about three weeks ago
with help from one of the main developers,
but since he's been very busy, nothing has come of it so far.

To avoid further duplication of effort, I am posting this here now.
This works with multiple backends and multiple frontends including mythweb


PS

-flagged ads _and_ cutlists are honoured
-optionally the preview comes from the bookmark
-you can see where you left off
-you can force mythweb to display a particular frame by setting a bookmark
-new backend query 'QUERY_PIXMAP_LASTMODIFIED'
-needed for remote frontends to check if the file is out of date
-needed to check if file on slave BE is out of date
-made it possible for a remote frontend to refresh its cache
-if another frontend has regenerated the pixmap and the preview
is actually newer than the cached copy, (reload but don't regenerate).
-fixed a bug in mythcontext.cpp,
-errors were spewed if the pixmap was not a part of a theme.
-ie it was a preview that didn't exist yet.
-i am just returning NULL instead of wasting time
on trying to load an image that doesn't exist.
-patched mythweb to use the new query to dynamically update its previews
-works even if mythweb is installed on a dedicated box.


Works like a charm for me,
and I tested everything I could think of.
:)
let me know how i did,
I could use the constructive criticism.
Attachments: mythtv-dynamic-previews-final.diff.gz (4.39 KB)
  mythweb-dynamic-previews-final.diff.gz (1.35 KB)


mccoyn at gmail

Mar 22, 2005, 5:48 AM

Post #4 of 5 (864 views)
Permalink
Re: re: Preview images - skip commercial breaks. [In reply to]

I will definantly give your patch a try when I get a chance. The more
I worked on it, the more it seemed I would have to do DB stuff, which
I'm not very experienced with. I hadn't even thought about multiple
backends. Its good to see thats all done already.


On Mon, 21 Mar 2005 16:40:02 -0000, Risto Treksler
<risto [at] elkhornbanff> wrote:
> Hi,
>
> I coded this this about three weeks ago
> with help from one of the main developers,
> but since he's been very busy, nothing has come of it so far.
>
> To avoid further duplication of effort, I am posting this here now.
> This works with multiple backends and multiple frontends including mythweb
>
> PS
>
> -flagged ads _and_ cutlists are honoured
> -optionally the preview comes from the bookmark
> -you can see where you left off
> -you can force mythweb to display a particular frame by setting a bookmark
> -new backend query 'QUERY_PIXMAP_LASTMODIFIED'
> -needed for remote frontends to check if the file is out of date
> -needed to check if file on slave BE is out of date
> -made it possible for a remote frontend to refresh its cache
> -if another frontend has regenerated the pixmap and the preview
> is actually newer than the cached copy, (reload but don't regenerate).
> -fixed a bug in mythcontext.cpp,
> -errors were spewed if the pixmap was not a part of a theme.
> -ie it was a preview that didn't exist yet.
> -i am just returning NULL instead of wasting time
> on trying to load an image that doesn't exist.
> -patched mythweb to use the new query to dynamically update its previews
> -works even if mythweb is installed on a dedicated box.
>
> Works like a charm for me,
> and I tested everything I could think of.
> :)
> let me know how i did,
> I could use the constructive criticism.
>
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
>
>
>
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


cpinkham at bc2va

May 4, 2005, 8:04 PM

Post #5 of 5 (818 views)
Permalink
Re: re: Preview images - skip commercial breaks. [In reply to]

> I coded this this about three weeks ago

Thanks,

This patch has been committed to CVS. Sorry I took so long. It is dependent
on some code in CommDetect that is in the process of being moved out of
libmythtv, so I was debating modifying your patch and committing it after
the CommDetect changes, but I decided to go ahead and put your patch in
and then just modify the code later to work with the pending CommDetect
changes.

--
Chris

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.