forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 803394 - Use Android ColorConverter class for video color convers…
…ion on Gingerbread r=doublec
- Loading branch information
Showing
7 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright (C) 2009 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. | ||
*/ | ||
|
||
#ifndef COLOR_CONVERTER_H_ | ||
|
||
#define COLOR_CONVERTER_H_ | ||
|
||
#include <sys/types.h> | ||
|
||
#include <stdint.h> | ||
|
||
#include <OMX_Video.h> | ||
|
||
namespace android { | ||
|
||
struct ColorConverter { | ||
ColorConverter(OMX_COLOR_FORMATTYPE from, OMX_COLOR_FORMATTYPE to); | ||
~ColorConverter(); | ||
|
||
bool isValid() const; | ||
|
||
void convert( | ||
size_t width, size_t height, | ||
const void *srcBits, size_t srcSkip, | ||
void *dstBits, size_t dstSkip); | ||
|
||
private: | ||
OMX_COLOR_FORMATTYPE mSrcFormat, mDstFormat; | ||
uint8_t *mClip; | ||
|
||
uint8_t *initClip(); | ||
|
||
void convertCbYCrY( | ||
size_t width, size_t height, | ||
const void *srcBits, size_t srcSkip, | ||
void *dstBits, size_t dstSkip); | ||
|
||
void convertYUV420Planar( | ||
size_t width, size_t height, | ||
const void *srcBits, size_t srcSkip, | ||
void *dstBits, size_t dstSkip); | ||
|
||
void convertQCOMYUV420SemiPlanar( | ||
size_t width, size_t height, | ||
const void *srcBits, size_t srcSkip, | ||
void *dstBits, size_t dstSkip); | ||
|
||
void convertYUV420SemiPlanar( | ||
size_t width, size_t height, | ||
const void *srcBits, size_t srcSkip, | ||
void *dstBits, size_t dstSkip); | ||
|
||
ColorConverter(const ColorConverter &); | ||
ColorConverter &operator=(const ColorConverter &); | ||
}; | ||
|
||
} // namespace android | ||
|
||
#endif // COLOR_CONVERTER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
media/omx-plugin/lib/gb/libstagefright_color_conversion/Makefile.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright 2012 Mozilla Foundation and Mozilla contributors | ||
# | ||
# 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. | ||
DEPTH = @DEPTH@ | ||
topsrcdir = @top_srcdir@ | ||
srcdir = @srcdir@ | ||
VPATH = @srcdir@ | ||
|
||
include $(DEPTH)/config/autoconf.mk | ||
|
||
MODULE = libstagefright_color_conversion | ||
MODULE_NAME = libstagefright_color_conversion | ||
LIBRARY_NAME = stagefright_color_conversion | ||
FORCE_SHARED_LIB = 1 | ||
|
||
# Don't use STL wrappers; this isn't Gecko code | ||
STL_FLAGS = | ||
|
||
# must link statically with the CRT; this isn't Gecko code | ||
USE_STATIC_LIBS = 1 | ||
|
||
# Need to custom install OMX media plugin | ||
NO_DIST_INSTALL = 1 | ||
NO_INSTALL = 1 | ||
|
||
ifneq ($(MOZ_WIDGET_TOOLKIT),gonk) | ||
CPPSRCS = \ | ||
libstagefright_color_conversion.cpp \ | ||
$(NULL) | ||
endif | ||
|
||
include $(topsrcdir)/config/rules.mk | ||
|
||
ifdef GNU_CXX | ||
# Turn off C++ 11 features due to conflicts with Android OS headers and char16_t definition | ||
CXXFLAGS += -std=gnu++98 | ||
endif | ||
|
||
INCLUDES += \ | ||
-I$(topsrcdir)/media/omx-plugin/include/gb \ | ||
-I$(topsrcdir)/media/omx-plugin/include/gb/media/stagefright/openmax \ | ||
$(NULL) | ||
|
||
# EXTRA_DSO_LDOPTS += \ | ||
# -L$(DEPTH)/media/omx-plugin/lib/gb/libutils \ | ||
# -lutils \ | ||
# $(NULL) |
27 changes: 27 additions & 0 deletions
27
media/omx-plugin/lib/gb/libstagefright_color_conversion/libstagefright_color_conversion.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* vim:set ts=2 sw=2 sts=2 et cindent: */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "mozilla/Types.h" | ||
#include "stagefright/ColorConverter.h" | ||
|
||
namespace android { | ||
|
||
MOZ_EXPORT ColorConverter::ColorConverter(OMX_COLOR_FORMATTYPE srcFormat, | ||
OMX_COLOR_FORMATTYPE dstFormat) | ||
{ | ||
} | ||
|
||
MOZ_EXPORT bool ColorConverter::isValid() const { return false; } | ||
|
||
MOZ_EXPORT void ColorConverter::convert(unsigned int, unsigned int, | ||
const void*, unsigned int, | ||
void*, unsigned int) | ||
{ | ||
} | ||
|
||
MOZ_EXPORT ColorConverter::~ColorConverter() { } | ||
|
||
} // namespace android |