This file is indexed.

/usr/include/libffmpegthumbnailer/videothumbnailer.h is in libffmpegthumbnailer-dev 2.1.1-0.1+b3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//    Copyright (C) 2010 Dirk Vanden Boer <dirk.vdb@gmail.com>
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#ifndef VIDEO_THUMBNAILER_H
#define VIDEO_THUMBNAILER_H

#include <string>
#include <vector>
#include <map>
#include <cinttypes>
#include <functional>

#include "ifilter.h"
#include "ffmpegthumbnailertypes.h"

struct AVFormatContext;

namespace ffmpegthumbnailer
{

struct VideoFrame;
class ImageWriter;
class MovieDecoder;
template <typename T>
struct Histogram;

class VideoThumbnailer
{
public:
    VideoThumbnailer();
    VideoThumbnailer(int thumbnailSize, bool workaroundIssues, bool maintainAspectRatio, int imageQuality, bool smartFrameSelection);
    ~VideoThumbnailer();

    void generateThumbnail(const std::string& videoFile, ThumbnailerImageType type, const std::string& outputFile, AVFormatContext* pAvContext = nullptr);
    void generateThumbnail(const std::string& videoFile, ThumbnailerImageType type, std::vector<uint8_t>& buffer, AVFormatContext* pAvContext = nullptr);

    void setThumbnailSize(int size);
    void setSeekPercentage(int percentage);
    void setSeekTime(const std::string& seekTime);
    void setWorkAroundIssues(bool workAround);
    void setImageQuality(int imageQuality);
    void setMaintainAspectRatio(bool enabled);
    void setSmartFrameSelection(bool enabled);
    void addFilter(IFilter* pFilter);
    void removeFilter(IFilter* pFilter);
    void clearFilters();

    void setLogCallback(std::function<void(ThumbnailerLogLevel, const std::string&)> cb);

private:
    void generateThumbnail(const std::string& videoFile, ImageWriter& imageWriter, AVFormatContext* pAvContext = nullptr);
    void generateSmartThumbnail(MovieDecoder& movieDecoder, VideoFrame& videoFrame);
    void writeImage(const std::string& videoFile, ImageWriter& imageWriter, const VideoFrame& videoFrame, int duration, std::vector<uint8_t*>& rowPointers);

    std::string getMimeType(const std::string& videoFile);
    std::string getExtension(const std::string& videoFilename);

    void generateHistogram(const VideoFrame& videoFrame, Histogram<int>& histogram);
    int getBestThumbnailIndex(std::vector<VideoFrame>& videoFrames, const std::vector<Histogram<int> >& histograms);
    void applyFilters(VideoFrame& frameData);

    void TraceMessage(ThumbnailerLogLevel lvl, const std::string& msg);

private:
    int                                             m_ThumbnailSize;
    uint16_t                                        m_SeekPercentage;
    bool                                            m_OverlayFilmStrip;
    bool                                            m_WorkAroundIssues;
    int                                             m_ImageQuality;
    bool                                            m_MaintainAspectRatio;
    bool                                            m_SmartFrameSelection;
    std::string                                     m_SeekTime;
    std::vector<IFilter*>                           m_Filters;

    std::function<void(ThumbnailerLogLevel, const std::string&)> m_LogCb;

    friend class VideoThumbnailerTest;
};

}

#endif