Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b26747de authored by Dichen Zhang's avatar Dichen Zhang Committed by Android (Google) Code Review
Browse files

Merge "jpegrecoverymap: Add error code"

parents f0ab2c87 80b7248c
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <utils/Errors.h>

namespace android::recoverymap {

enum {
    // status_t map for errors in the media framework
    // OK or NO_ERROR or 0 represents no error.

    // See system/core/include/utils/Errors.h
    // System standard errors from -1 through (possibly) -133
    //
    // Errors with special meanings and side effects.
    // INVALID_OPERATION:  Operation attempted in an illegal state (will try to signal to app).
    // DEAD_OBJECT:        Signal from CodecBase to MediaCodec that MediaServer has died.
    // NAME_NOT_FOUND:     Signal from CodecBase to MediaCodec that the component was not found.

    // JPEGR errors
    JPEGR_IO_ERROR_BASE                 = -10000,
    ERROR_JPEGR_INVALID_INPUT_TYPE      = JPEGR_IO_ERROR_BASE,
    ERROR_JPEGR_INVALID_OUTPUT_TYPE     = JPEGR_IO_ERROR_BASE - 1,
    ERROR_JPEGR_INVALID_NULL_PTR        = JPEGR_IO_ERROR_BASE - 2,

    JPEGR_RUNTIME_ERROR_BASE            = -20000,
    ERROR_JPEGR_ENCODE_ERROR            = JPEGR_RUNTIME_ERROR_BASE - 1,
    ERROR_JPEGR_DECODE_ERROR            = JPEGR_RUNTIME_ERROR_BASE - 2,
    ERROR_JPEGR_CALCULATION_ERROR       = JPEGR_RUNTIME_ERROR_BASE - 3,
    ERROR_JPEGR_METADATA_ERROR          = JPEGR_RUNTIME_ERROR_BASE - 4,
};

}  // namespace android::recoverymap
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

 #include <utils/Errors.h>
#include "jpegrerrorcode.h"

namespace android::recoverymap {

+10 −10
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image,
  if (uncompressed_p010_image == nullptr
   || uncompressed_yuv_420_image == nullptr
   || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -40,7 +40,7 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image,
   || uncompressed_yuv_420_image == nullptr
   || compressed_jpeg_image == nullptr
   || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -53,7 +53,7 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image,
  if (uncompressed_p010_image == nullptr
   || compressed_jpeg_image == nullptr
   || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -62,7 +62,7 @@ status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image,

status_t RecoveryMap::decodeJPEGR(void* compressed_jpegr_image, jr_uncompressed_ptr dest) {
  if (compressed_jpegr_image == nullptr || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -72,7 +72,7 @@ status_t RecoveryMap::decodeJPEGR(void* compressed_jpegr_image, jr_uncompressed_
status_t RecoveryMap::decodeRecoveryMap(jr_compressed_ptr compressed_recovery_map,
                                        jr_uncompressed_ptr dest) {
  if (compressed_recovery_map == nullptr || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -82,7 +82,7 @@ status_t RecoveryMap::decodeRecoveryMap(jr_compressed_ptr compressed_recovery_ma
status_t RecoveryMap::encodeRecoveryMap(jr_uncompressed_ptr uncompressed_recovery_map,
                                        jr_compressed_ptr dest) {
  if (uncompressed_recovery_map == nullptr || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -95,7 +95,7 @@ status_t RecoveryMap::generateRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_4
  if (uncompressed_yuv_420_image == nullptr
   || uncompressed_p010_image == nullptr
   || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -108,7 +108,7 @@ status_t RecoveryMap::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_
  if (uncompressed_yuv_420_image == nullptr
   || uncompressed_recovery_map == nullptr
   || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -117,7 +117,7 @@ status_t RecoveryMap::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_

status_t RecoveryMap::extractRecoveryMap(void* compressed_jpegr_image, jr_compressed_ptr dest) {
  if (compressed_jpegr_image == nullptr || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD
@@ -130,7 +130,7 @@ status_t RecoveryMap::appendRecoveryMap(void* compressed_jpeg_image,
  if (compressed_jpeg_image == nullptr
   || compressed_recovery_map == nullptr
   || dest == nullptr) {
    return BAD_VALUE;
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }

  // TBD