Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your question is very broad in perspective and hence, I will refer you to corresponding paths to get an understanding of the overall system.</p> <p>First, the overall processing of <code>media files</code> starts from the <code>Gallery</code> application. Though not the entry point, <a href="http://androidxref.com/4.2.2_r1/xref/packages/apps/Gallery2/src/com/android/gallery3d/data/ImageCacheRequest.java#46" rel="nofollow"><code>ImageCacheRequest</code></a> could be a good reference point to start the study, which shows how a cached image is read and rendered onto the screen.</p> <p>Next, to understand how this thumbnail is generated, you will have to refer to <a href="http://androidxref.com/4.2.2_r1/xref/packages/apps/Camera/src/com/android/camera/Thumbnail.java" rel="nofollow"><code>ThumbnailManager.java</code></a> which is invoked from <code>camera</code>, <code>mms</code> etc. </p> <p><code>Thumbnail</code> class internally employs <a href="http://androidxref.com/4.2.2_r1/xref/frameworks/base/media/java/android/media/MediaMetadataRetriever.java" rel="nofollow"><code>MediaMetadataRetriever</code></a> which is the main class for retrieving the thumbnail data.</p> <p><code>MediaMetadataRetriever</code> has a corresponding <code>JNI</code> implementation as shown <a href="http://androidxref.com/4.2.2_r1/xref/frameworks/base/media/jni/android_media_MediaMetadataRetriever.cpp" rel="nofollow">here</a>. The main function of interest is <code>getFrameAtTime</code>.</p> <p>The most common implementation is <a href="http://androidxref.com/4.2.2_r1/xref/frameworks/av/media/libstagefright/StagefrightMetadataRetriever.cpp" rel="nofollow"><code>StagefrightMetadataRetriever</code></a>, which works on a simple principle. First, a <code>MediaExtractor</code> i.e. a parser is created which will <em>sniff</em> out the media-file type and create a corresponding parser entity as shown <a href="http://androidxref.com/4.2.2_r1/xref/frameworks/av/media/libstagefright/StagefrightMetadataRetriever.cpp#321" rel="nofollow">here</a>. Next, the parser will then invoke a codec to decode the corresponding <strong>key frame</strong> at the requested time stamp and provide the image back as can be observed in <a href="http://androidxref.com/4.2.2_r1/xref/frameworks/av/media/libstagefright/StagefrightMetadataRetriever.cpp#extractVideoFrameWithCodecFlags" rel="nofollow"><code>extractVideoFramewithFlags</code></a>. </p> <p>Inside this function, a <a href="http://androidxref.com/4.2.2_r1/xref/frameworks/av/media/libstagefright/StagefrightMetadataRetriever.cpp#156" rel="nofollow">codec is created</a>, frame is decoded, color converted and returned back to the caller which will transfer the same to the higher application.</p> <p>In a nutshell, I feel your player will not come into picture and as long as the corresponding parsers and codecs are registered with the system, the thumbnails will be generated .</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload