Skip to content

Commit

Permalink
記事を書いた
Browse files Browse the repository at this point in the history
  • Loading branch information
takusan23 committed Oct 28, 2024
1 parent 672c6ec commit b0179e7
Show file tree
Hide file tree
Showing 4 changed files with 533 additions and 7 deletions.
20 changes: 13 additions & 7 deletions content/posts/amairo_kotlin_coroutines_suspend.md
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,7 @@ https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html
|-----------------------|----------------------------------------------------------------------------------|----------------------------------------|
| `Dispatchers.Default` | メインスレッド以外のスレッドで、CPU を消費する処理向けです。 | 2 個以上`CPU のコア数`以下 |
| `Dispatchers.IO` | メインスレッド以外のスレッドで、インターネット通信や、ファイル読み書き向けです。 | 少なくとも 64 個、足りなければ増える。 |
| `Dispatchers.Main` | メインスレッドです。 | 1 個 |
| `Dispatchers.Main` | メインスレッドです。 | 1 個 |

`Default``IO`は、`Dispatchers`が複数のスレッドを持っている(雇っている)形になります。
その時空いているスレッドが使われる感じです。
Expand Down Expand Up @@ -3058,12 +3058,18 @@ class MainActivity : ComponentActivity() {
# Flow と Channel
https://kotlinlang.org/docs/flow.html

<p style="font-size:30px; color:red">省略します!!!</p>
<p style="font-size:30px; color:red; ">↓書きました↓</p>

やる気があれば`Flow`の話をします。
というのも`Flow`はサスペンド関数のそれ同じくらい内容があってそれだけで記事一本出来てしまうので。。。
https://takusan.negitoro.dev/posts/amairo_kotlin_coroutines_flow/

いやだって目次が多すぎる。。。
<del>
<p style="font-size:30px; color:red; ">省略します!!!</p>
</del>

~~やる気があれば`Flow`の話をします。~~
~~というのも`Flow`はサスペンド関数のそれ同じくらい内容があってそれだけで記事一本出来てしまうので。。。~~

~~いやだって目次が多すぎる。。。~~

# 例外
例外の話です。地味に新しい事実がある
Expand Down Expand Up @@ -3642,8 +3648,8 @@ https://stackoverflow.com/questions/1050222/

| | 平行(同時に起動する) | 並列(同時に処理する。使うスレッド数を制限する) |
|----------|------------------------|--------------------------------------------------|
| 1つだけ | Mutex() | limitedParallelism(1) |
| 上限付き | Semaphore(上限の数) | limitedParallelism(上限の数) |
| 1つだけ | Mutex() | limitedParallelism(1) |
| 上限付き | Semaphore(上限の数) | limitedParallelism(上限の数) |

### Mutex
例えば以下の関数は`withLock { }`の中からのみ呼び出されているため、`successTask()`を3つ並列にしても、1つずつ処理されることになります。
Expand Down
2 changes: 2 additions & 0 deletions content/posts/android_akari_droid_create_video.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ tags:

# 作った動画

https://www.nicovideo.jp/watch/sm44212192

<script type="application/javascript" src="https://embed.nicovideo.jp/watch/sm44212192/script?w=640&h=360"></script><noscript><a href="https://www.nicovideo.jp/watch/sm44212192">【ゆっくり実況】自作MODを新しいバージョンに追従するまで(1.20.6)</a></noscript>

`1080p(1920x1080)`の、`60fps`なので、なかなか豪華。
Expand Down
9 changes: 9 additions & 0 deletions content/posts/android_front_back_camera_2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ https://takusan.negitoro.dev/posts/android_front_back_camera/

https://play.google.com/store/apps/details?id=io.github.takusan23.komadroid

# 追記 2024/10/29
`CameraX`が追いついてきました。
もう私みたいに`OpenGL ES`のシェーダーやら何やら書くこと無く、2つのカメラ映像を重ねた状態で`SurfaceView`で表示したり、`MediaCodec`で録画できるらしいです。

https://android-developers.googleblog.com/2024/10/camerax-update-makes-dual-concurrent-camera-easier.html

悔しい...ですよね?
もう`CameraX`を使えばいいと思いました。

# ざっくり概要
前面背面それぞれプレビュー用の`SurfaceView`を持つと、見る分には良いのですが、静止画、動画撮影が出来ないんですよね。
なので、どうにかして一つの`Surface`に合成する必要があります。
Expand Down
Loading

0 comments on commit b0179e7

Please sign in to comment.