Merge lp://staging/~fboucault/thumbnailer/new_qml_api into lp://staging/thumbnailer

Proposed by Florian Boucault
Status: Rejected
Rejected by: Michi Henning
Proposed branch: lp://staging/~fboucault/thumbnailer/new_qml_api
Merge into: lp://staging/thumbnailer
Diff against target: 777 lines (+631/-14)
13 files modified
debian/libthumbnailer0.symbols (+1/-0)
include/thumbnailer.h (+9/-0)
plugins/Ubuntu/Thumbnailer/CMakeLists.txt (+2/-0)
plugins/Ubuntu/Thumbnailer/plugin.cpp (+3/-0)
plugins/Ubuntu/Thumbnailer/qthumbnailer.cpp (+260/-0)
plugins/Ubuntu/Thumbnailer/qthumbnailer.h (+114/-0)
plugins/Ubuntu/Thumbnailer/thumbnailqueue.cpp (+45/-0)
plugins/Ubuntu/Thumbnailer/thumbnailqueue.h (+41/-0)
src/libthumbnailer.map (+1/-0)
src/thumbnailer.cpp (+33/-12)
tests/basic.cpp (+23/-0)
tests/qml/tst_image_provider.qml (+2/-2)
tests/qml/tst_thumbnailer.qml (+97/-0)
To merge this branch: bzr merge lp://staging/~fboucault/thumbnailer/new_qml_api
Reviewer Review Type Date Requested Status
Michi Henning (community) Disapprove
Florian Boucault (community) Needs Fixing
Jussi Pakkanen (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Xavi Garcia (community) Needs Fixing
Review via email: mp+250832@code.staging.launchpad.net

Commit message

New QML Thumbnailer API allowing custom thumbnailing schedule.

Videos are queued thumbnailed independently from pictures resulting in a better user experience.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
138. By Florian Boucault

added unit test

139. By Florian Boucault

Clearer test

140. By Florian Boucault

Added missing symbol

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
141. By Florian Boucault

Added QML tests

142. By Florian Boucault

Added more QML tests

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

I didn't get to review the functional bits quite yet, but here are some simpler issues in the mean time.

- the qml tests don't seem to be run
- the bit that converts relative file names to absolute ones is duplicated in get_thumbnail and needs_generation, please move it to a shared function in an anonymous namespace
- the name needs_generation seems a bit backwards, would it be better to call it is_cached instead

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

Qml tests not being run automatically is not a new issue. Should be fixed
separately.
Le 25 févr. 2015 07:52, "Jussi Pakkanen" <email address hidden> a
écrit :

> Review: Needs Fixing
>
> I didn't get to review the functional bits quite yet, but here are some
> simpler issues in the mean time.
>
> - the qml tests don't seem to be run
> - the bit that converts relative file names to absolute ones is duplicated
> in get_thumbnail and needs_generation, please move it to a shared function
> in an anonymous namespace
> - the name needs_generation seems a bit backwards, would it be better to
> call it is_cached instead
>
> --
> https://code.launchpad.net/~fboucault/thumbnailer/new_qml_api/+merge/250832
> You are the owner of lp:~fboucault/thumbnailer/new_qml_api.
>

Revision history for this message
Xavi Garcia (xavi-garcia-mena) wrote :

Other minor changes:

 - The new added symbol:
+ (c++)"Thumbnailer::thumbnail_needs_generation(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ThumbnailSize)@Base" 1.1

The version should be 0replaceme instead of 1.1, so the debian machinery sets the right value.

 - In the newly created file qthumbnailer.h members should follow the same rules. Either to have the m_/s_ prefix or none. The first class have prefixes while the second doesn't.

review: Needs Fixing
143. By Florian Boucault

Use proper generic version for new symbol

144. By Florian Boucault

ThumbnailTask to follow the m_/s_ syntax convention used in other classes.

145. By Florian Boucault

Renamed thumbnail_needs_generation into thumbnail_is_cached

Revision history for this message
Florian Boucault (fboucault) wrote :

> Other minor changes:
>
> - The new added symbol:
> + (c++)"Thumbnailer::thumbnail_needs_generation(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, ThumbnailSize)@Base"
> 1.1
>
> The version should be 0replaceme instead of 1.1, so the debian machinery sets
> the right value.
>

Fixed.

> - In the newly created file qthumbnailer.h members should follow the same
> rules. Either to have the m_/s_ prefix or none. The first class have prefixes
> while the second doesn't.

Fixed.

146. By Florian Boucault

Factorised common code between thumbnail_is_cached and get_thumbnail into a private function.

Revision history for this message
Florian Boucault (fboucault) wrote :

> I didn't get to review the functional bits quite yet, but here are some
> simpler issues in the mean time.
>
> - the qml tests don't seem to be run
> - the bit that converts relative file names to absolute ones is duplicated in
> get_thumbnail and needs_generation, please move it to a shared function in an
> anonymous namespace

Fixed.

> - the name needs_generation seems a bit backwards, would it be better to call
> it is_cached instead

Fixed.

147. By Florian Boucault

Removed manual example

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

To me this seems a fix on the wrong level, that is, it'll mean people have to use Thumbnail {} instead of Image {}, ideally we could still use Image {} and have parallization at the Qt level, though obviously that means convincing the Qt people that this makes sense and getting it accepted upstream.

Revision history for this message
Michał Sawicz (saviq) wrote :

Right, +1 to the above. Can you mark this as being a workaround for QTBUG-37988 please.

Revision history for this message
Florian Boucault (fboucault) wrote :

> To me this seems a fix on the wrong level, that is, it'll mean people have to
> use Thumbnail {} instead of Image {}, ideally we could still use Image {} and
> have parallization at the Qt level, though obviously that means convincing the
> Qt people that this makes sense and getting it accepted upstream.

No matter how much we patch Qt it will never do the right thing, ie. when a thumbnail is being generated, loading thumbnails that have already been generated previously should not be blocked.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Let me try to condense Florian's concerns for those who have not had to deal with the process of thumbnailing.

Creating a video screenshot thumbnail takes several seconds (up to 5) on the device.

Creating a thumbnail for other types (mostly images) takes a fraction of a second. Loading a preexisting thumbnail takes roughly the same.

Suppose you have n threads for thumbnailing and want to display n videos and m images. If you submit the videos first, the images are stuck until the first video gets processed.

What we want is to be able to submit both images and videos and have the system prioritise those thumbnails that are quick to load (like, say, reserving one thread for them and one for video screenshots).

Qt's image provider does not have priorisation capabilities and to fix our use case something like that needs to be added to Qt. This is the Correct thing to do, but on the other hand it is a lot more work than just increasing the amount of threads for QQuickImageProviders.

Revision history for this message
Florian Boucault (fboucault) wrote :

> Let me try to condense Florian's concerns for those who have not had to deal
> with the process of thumbnailing.
>
> Creating a video screenshot thumbnail takes several seconds (up to 5) on the
> device.
>
> Creating a thumbnail for other types (mostly images) takes a fraction of a
> second. Loading a preexisting thumbnail takes roughly the same.
>
> Suppose you have n threads for thumbnailing and want to display n videos and m
> images. If you submit the videos first, the images are stuck until the first
> video gets processed.
>
> What we want is to be able to submit both images and videos and have the
> system prioritise those thumbnails that are quick to load (like, say,
> reserving one thread for them and one for video screenshots).
>
> Qt's image provider does not have priorisation capabilities and to fix our use
> case something like that needs to be added to Qt. This is the Correct thing to
> do, but on the other hand it is a lot more work than just increasing the
> amount of threads for QQuickImageProviders.

Yes and no. I am also fixing a case that you merged with another one as being the same:
case 1) image with non existing thumbnail
case 2) video with non existing thumbnail
case 3) any media with already existing thumbnail

1) is fast but not instant
2) is slow
3) is instant

But because of the queuing, if a video is being thumbnailed, 1) and 3) become slow.
Adding N more threads to the image provider infrastructure would fix the issue of 1) becoming slow but 3) would still not be instant in some cases.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

LGTM. One thing to note is that there are two queues called video and image. The image queue deals with other image types besides images, such as audio files (and possibly in the future also pdf files, libreoffice docs etc). Thus it might make sense to rename it s_otherQueue, s_basicQueue or something like that. This is totally up to you, though, and not a requirement.

review: Approve
Revision history for this message
Florian Boucault (fboucault) wrote :

Will be reworked in 1-2 weeks to make use of the new Qt QQuickImageProvider async API that aacid is working on. That will allow us to not have that new Thmubnailer {} QML API.

review: Needs Fixing
Revision history for this message
Michi Henning (michihenning) wrote :

Rejecting this, seeing it is obsolete.

review: Disapprove

Unmerged revisions

147. By Florian Boucault

Removed manual example

146. By Florian Boucault

Factorised common code between thumbnail_is_cached and get_thumbnail into a private function.

145. By Florian Boucault

Renamed thumbnail_needs_generation into thumbnail_is_cached

144. By Florian Boucault

ThumbnailTask to follow the m_/s_ syntax convention used in other classes.

143. By Florian Boucault

Use proper generic version for new symbol

142. By Florian Boucault

Added more QML tests

141. By Florian Boucault

Added QML tests

140. By Florian Boucault

Added missing symbol

139. By Florian Boucault

Clearer test

138. By Florian Boucault

added unit test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: