Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
SkVideoEncoder.cpp File Reference
#include "experimental/ffmpeg/SkVideoEncoder.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/private/base/SkTDArray.h"
#include "libswscale/swscale.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkSurface.h"
#include "src/core/SkYUVMath.h"

Go to the source code of this file.

Classes

class  SkRandomAccessWStream
 

Functions

static bool check_err (int err, const int silentList[]=nullptr)
 
static int sk_write_packet (void *ctx, uint8_t *buffer, int size)
 
static int64_t sk_seek_packet (void *ctx, int64_t pos, int whence)
 
static bool is_valid (SkISize dim)
 

Function Documentation

◆ check_err()

static bool check_err ( int  err,
const int  silentList[] = nullptr 
)
static

Definition at line 62 of file SkVideoEncoder.cpp.

62 {
63 if (err >= 0) {
64 return false;
65 }
66
67 if (silentList) {
68 for (; *silentList; ++silentList) {
69 if (*silentList == err) {
70 return true; // we still report the error, but we don't printf
71 }
72 }
73 }
74
75 char errbuf[128];
76 const char *errbuf_ptr = errbuf;
77
78 if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) {
79 errbuf_ptr = strerror(AVUNERROR(err));
80 }
81 SkDebugf("%s\n", errbuf_ptr);
82 return true;
83}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1

◆ is_valid()

static bool is_valid ( SkISize  dim)
static

Definition at line 220 of file SkVideoEncoder.cpp.

220 {
221 if (dim.width() <= 0 || dim.height() <= 0) {
222 return false;
223 }
224 // need the dimensions to be even for YUV 420
225 return ((dim.width() | dim.height()) & 1) == 0;
226}
constexpr int32_t width() const
Definition SkSize.h:36
constexpr int32_t height() const
Definition SkSize.h:37

◆ sk_seek_packet()

static int64_t sk_seek_packet ( void *  ctx,
int64_t  pos,
int  whence 
)
static

Definition at line 91 of file SkVideoEncoder.cpp.

91 {
93 switch (whence) {
94 case SEEK_SET:
95 break;
96 case SEEK_CUR:
97 pos = (int64_t)stream->pos() + pos;
98 break;
99 case SEEK_END:
100 pos = (int64_t)stream->size() + pos;
101 break;
102 default:
103 return -1;
104 }
105 if (pos < 0 || pos > (int64_t)stream->size()) {
106 return -1;
107 }
108 stream->seek(SkToSizeT(pos));
109 return pos;
110}
SkPoint pos
constexpr size_t SkToSizeT(S x)
Definition SkTo.h:31

◆ sk_write_packet()

static int sk_write_packet ( void *  ctx,
uint8_t *  buffer,
int  size 
)
static

Definition at line 85 of file SkVideoEncoder.cpp.

85 {
87 stream->write(buffer, size);
88 return size;
89}
static const uint8_t buffer[]
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259