1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.providers.media; 18 19 import android.net.Uri; 20 import android.os.Bundle; 21 import java.io.PrintWriter; 22 23 /** Interface over MediaTranscodeManager access */ 24 public interface TranscodeHelper { freeCache(long bytes)25 public void freeCache(long bytes); 26 onAnrDelayStarted(String packageName, int uid, int tid, int reason)27 public void onAnrDelayStarted(String packageName, int uid, int tid, int reason); 28 transcode(String src, String dst, int uid, int reason)29 public boolean transcode(String src, String dst, int uid, int reason); 30 getIoPath(String path, int uid)31 public String getIoPath(String path, int uid); 32 shouldTranscode(String path, int uid, Bundle bundle)33 public int shouldTranscode(String path, int uid, Bundle bundle); 34 supportsTranscode(String path)35 public boolean supportsTranscode(String path); 36 onUriPublished(Uri uri)37 public void onUriPublished(Uri uri); 38 onFileOpen(String path, String ioPath, int uid, int transformsReason)39 public void onFileOpen(String path, String ioPath, int uid, int transformsReason); 40 isTranscodeFileCached(String path, String transcodePath)41 public boolean isTranscodeFileCached(String path, String transcodePath); 42 deleteCachedTranscodeFile(long rowId)43 public boolean deleteCachedTranscodeFile(long rowId); 44 dump(PrintWriter writer)45 public void dump(PrintWriter writer); 46 } 47