Leonid Plyushch
5 years ago
4 changed files with 69 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||
--- hiptext-2.0/src/artiste.cc 2019-03-01 19:40:54.553801723 +0800
|
|||
+++ hiptext-2.0_mod/src/artiste.cc 2019-03-01 17:33:22.031073100 +0800
|
|||
@@ -7,7 +7,7 @@
|
|||
#include <stdio.h> |
|||
#include <signal.h> |
|||
#include <sys/ioctl.h> |
|||
-#include <sys/termios.h>
|
|||
+#include <termios.h>
|
|||
#include <sys/select.h> |
|||
#include <gflags/gflags.h> |
|||
#include <glog/logging.h> |
@ -0,0 +1,18 @@ |
|||
TERMUX_PKG_HOMEPAGE=https://github.com/jart/hiptext |
|||
TERMUX_PKG_DESCRIPTION="Turn images into text better than caca/aalib" |
|||
TERMUX_PKG_LICENSE="Apache-2.0" |
|||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>" |
|||
TERMUX_PKG_VERSION=0.2 |
|||
TERMUX_PKG_REVISION=8 |
|||
TERMUX_PKG_SRCURL=https://github.com/jart/hiptext/releases/download/$TERMUX_PKG_VERSION/hiptext-$TERMUX_PKG_VERSION.tar.gz |
|||
TERMUX_PKG_SHA256=7f2217dec8775b445be6745f7bd439c24ce99c4316a9faf657bee7b42bc72e8f |
|||
TERMUX_PKG_DEPENDS="ffmpeg, freetype, gflags, google-glog, libjpeg-turbo, libpng, ncurses" |
|||
TERMUX_PKG_BUILD_DEPENDS="ragel" |
|||
TERMUX_PKG_BUILD_IN_SRC=true |
|||
|
|||
termux_step_pre_configure() { |
|||
#Font reference on file font.cc --> Patch by font.cc.patch |
|||
#Because of ttf-dejavu is x11 package, the hiptext is not a x11 package. |
|||
install -Dm600 -t "$TERMUX_PREFIX"/share/hiptext/ \ |
|||
"$TERMUX_PKG_SRCDIR"/DejaVuSansMono.ttf |
|||
} |
@ -0,0 +1,11 @@ |
|||
--- hiptext-0.2/src/font.cc 2019-03-03 13:47:56.235315625 +0800
|
|||
+++ hiptext-0.2_mod/src/font.cc 2019-03-03 13:56:39.610971934 +0800
|
|||
@@ -11,7 +11,7 @@
|
|||
#include "hiptext/graphic.h" |
|||
#include "hiptext/pixel.h" |
|||
|
|||
-DEFINE_string(font, "DejaVuSansMono.ttf",
|
|||
+DEFINE_string(font, "@TERMUX_PREFIX@/share/hiptext/DejaVuSansMono.ttf",
|
|||
"The path to the font .ttf file to use."); |
|||
DEFINE_int32(font_index, 0, "Index of face to use inside font .ttf file."); |
|||
DEFINE_int32(font_size, 11, "The size of the font in points."); |
@ -0,0 +1,29 @@ |
|||
--- hiptext-2.0/src/movie.cc 2019-03-01 19:40:54.553801723 +0800
|
|||
+++ hiptext-2.0_mod/src/movie.cc 2019-03-01 17:41:38.290586786 +0800
|
|||
@@ -53,7 +53,7 @@
|
|||
|
|||
// Prepare context for scaling and converting to RGB. |
|||
sws_ = sws_getContext(context_->width, context_->height, context_->pix_fmt, |
|||
- width_, height_, PIX_FMT_RGB24, SWS_FAST_BILINEAR,
|
|||
+ width_, height_, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR,
|
|||
nullptr, nullptr, nullptr); |
|||
CHECK(codec_ = avcodec_find_decoder(context_->codec_id)) |
|||
<< "Unsupported codec.\n"; |
|||
@@ -61,13 +61,13 @@
|
|||
<< "Could not open codec.\n"; |
|||
|
|||
// Allocate Raw + RGB frame buffers. |
|||
- CHECK(frame_ = avcodec_alloc_frame());
|
|||
- CHECK(frame_rgb_ = avcodec_alloc_frame());
|
|||
- int rgb_bytes = avpicture_get_size(PIX_FMT_RGB24, width_, height_);
|
|||
+ CHECK(frame_ = av_frame_alloc());
|
|||
+ CHECK(frame_rgb_ = av_frame_alloc());
|
|||
+ int rgb_bytes = avpicture_get_size(AV_PIX_FMT_RGB24, width_, height_);
|
|||
buffer_ = static_cast<uint8_t*>(av_malloc(rgb_bytes)); |
|||
LOG(INFO) << "RGB Buffer: " << rgb_bytes << " bytes."; |
|||
int prep = avpicture_fill(reinterpret_cast<AVPicture*>(frame_rgb_), |
|||
- buffer_, PIX_FMT_RGB24, width_, height_);
|
|||
+ buffer_, AV_PIX_FMT_RGB24, width_, height_);
|
|||
CHECK_GE(prep, 0) << "Failed to prepare RGB buffer."; |
|||
LOG(INFO) << "RGB dimensions: " << width_ << "x" << height_; |
|||
} |
Loading…
Reference in new issue