Skip to content

Commit

Permalink
Apply code format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FusionXu authored and actions-user committed Feb 15, 2022
1 parent 6456727 commit c8291ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/platform/android/JVideoDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include "platform/android/GPUDecoder.h"

extern "C" {
JNIEXPORT void Java_org_libpag_VideoDecoder_RegisterSoftwareDecoderFactory(JNIEnv*, jclass,
JNIEXPORT void Java_org_libpag_VideoDecoder_RegisterSoftwareDecoderFactory(JNIEnv *, jclass,
jlong factory) {
pag::PAGVideoDecoder::RegisterSoftwareDecoderFactory(
reinterpret_cast<pag::SoftwareDecoderFactory*>(factory));
reinterpret_cast<pag::SoftwareDecoderFactory *>(factory));
}

JNIEXPORT void Java_org_libpag_VideoDecoder_SetMaxHardwareDecoderCount(JNIEnv*, jclass,
JNIEXPORT void Java_org_libpag_VideoDecoder_SetMaxHardwareDecoderCount(JNIEnv *, jclass,
jint maxCount) {
pag::PAGVideoDecoder::SetMaxHardwareDecoderCount(maxCount);
}
Expand Down
14 changes: 8 additions & 6 deletions src/rendering/caches/RenderCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#include "base/utils/TimeUtil.h"
#include "base/utils/USE.h"
#include "base/utils/UniqueID.h"
#include "video/VideoDecoder.h"
#include "rendering/caches/ImageContentCache.h"
#include "rendering/caches/LayerCache.h"
#include "rendering/renderers/FilterRenderer.h"
#include "video/VideoDecoder.h"

namespace pag {
// 300M设置的大一些用于兜底,通常在大于20M时就开始随时清理。
Expand Down Expand Up @@ -167,9 +167,10 @@ void RenderCache::prepareFrame() {
for (auto& item : layerDistances) {
for (auto pagLayer : item.second) {
if (pagLayer->layerType() == LayerType::PreCompose) {
auto policy = VideoDecoder::SoftwareToHardwareEnabled()
&& item.first < MIN_HARDWARE_PREPARE_TIME
? DecodingPolicy::SoftwareToHardware : DecodingPolicy::Hardware;
auto policy =
VideoDecoder::SoftwareToHardwareEnabled() && item.first < MIN_HARDWARE_PREPARE_TIME
? DecodingPolicy::SoftwareToHardware
: DecodingPolicy::Hardware;
preparePreComposeLayer(static_cast<PreComposeLayer*>(pagLayer->layer), policy);
} else if (pagLayer->layerType() == LayerType::Image) {
prepareImageLayer(static_cast<PAGImageLayer*>(pagLayer));
Expand Down Expand Up @@ -422,8 +423,9 @@ std::shared_ptr<SequenceReader> RenderCache::getSequenceReader(Sequence* sequenc
if (reader == nullptr) {
auto file = stage->getSequenceFile(sequence);
reader = MakeSequenceReader(file, sequence,
VideoDecoder::SoftwareToHardwareEnabled() ?
DecodingPolicy::SoftwareToHardware : DecodingPolicy::Hardware);
VideoDecoder::SoftwareToHardwareEnabled()
? DecodingPolicy::SoftwareToHardware
: DecodingPolicy::Hardware);
if (reader && !staticComposition) {
// 完全静态的序列帧不用缓存。
sequenceCaches[compositionID] = reader;
Expand Down
10 changes: 5 additions & 5 deletions src/rendering/renderers/CompositionRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

#include "CompositionRenderer.h"
#include "LayerRenderer.h"
#include "video/VideoDecoder.h"
#include "rendering/caches/LayerCache.h"
#include "rendering/caches/RenderCache.h"
#include "rendering/graphics/Picture.h"
#include "rendering/graphics/Recorder.h"
#include "rendering/readers/BitmapSequenceReader.h"
#include "video/VideoDecoder.h"

namespace pag {
class SequenceProxy : public TextureProxy {
Expand All @@ -37,10 +37,10 @@ class SequenceProxy : public TextureProxy {
}

void prepare(RenderCache* cache) const override {
static_cast<RenderCache*>(cache)->
prepareSequenceReader(sequence, frame,
VideoDecoder::SoftwareToHardwareEnabled() ?
DecodingPolicy::SoftwareToHardware : DecodingPolicy::Hardware);
static_cast<RenderCache*>(cache)->prepareSequenceReader(
sequence, frame,
VideoDecoder::SoftwareToHardwareEnabled() ? DecodingPolicy::SoftwareToHardware
: DecodingPolicy::Hardware);
}

std::shared_ptr<Texture> getTexture(RenderCache* cache) const override {
Expand Down

0 comments on commit c8291ec

Please sign in to comment.